Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Attempt to read property "post_parent" on null

Exception

ErrorException

  1.     {
  2.         // Get the current page object
  3.         global $post;
  4.         // Check if the current page has a parent
  5.         if ($post->post_parent) {
  6.             // Get the parent page ID
  7.             $parent_page_id $post->post_parent;
  8.             // Check if the parent page ID is 112
  9.             if ($parent_page_id === 87) {
  1.      * @throws \ErrorException
  2.      */
  3.     public function handleError($level$message$file ''$line 0$context = [])
  4.     {
  5.         try {
  6.             parent::handleError($level$message$file$line$context);
  7.         } catch (Throwable $e) {
  8.             if (! apply_filters('acorn/throw_error_exception'true$e)) {
  9.                 return false;
  10.             }
  1.     {
  2.         // Get the current page object
  3.         global $post;
  4.         // Check if the current page has a parent
  5.         if ($post->post_parent) {
  6.             // Get the parent page ID
  7.             $parent_page_id $post->post_parent;
  8.             // Check if the parent page ID is 112
  9.             if ($parent_page_id === 87) {
  1.     public function with()
  2.     {
  3.         return [
  4.             'siteName' => $this->siteName(),
  5.             'breadCrumbs' => $this->breadCrumbs(),
  6.             'isTeachersCorner' => $this->is_teachers_corner(),
  7.             'randomClassHero' => $this->randomClassHero(),
  8.         ];
  9.     }
  1.      * @return array
  2.      */
  3.     protected function merge()
  4.     {
  5.         return array_merge(
  6.             $this->with(),
  7.             $this->view->getData(),
  8.             $this->override()
  9.         );
  10.     }
  1.     public function compose(View $view)
  2.     {
  3.         $this->view $view;
  4.         $this->data = new Fluent($view->getData());
  5.         $view->with($this->merge());
  6.     }
  7.     /**
  8.      * Data to be merged and passed to the view before rendering.
  9.      *
  1.         // Once we have the class and method name, we can build the Closure to resolve
  2.         // the instance out of the IoC container and call the method on it with the
  3.         // given arguments that are passed to the Closure as the composer's data.
  4.         return function () use ($class$method) {
  5.             return $this->container->make($class)->{$method}(...func_get_args());
  6.         };
  7.     }
  8.     /**
  9.      * Parse a class based composer name.
  1.      */
  2.     protected function addEventListener($name$callback)
  3.     {
  4.         if (str_contains($name'*')) {
  5.             $callback = function ($name, array $data) use ($callback) {
  6.                 return $callback($data[0]);
  7.             };
  8.         }
  9.         $this->events->listen($name$callback);
  10.     }
  1.             return $this->createClassListener($listener$wildcard);
  2.         }
  3.         return function ($event$payload) use ($listener$wildcard) {
  4.             if ($wildcard) {
  5.                 return $listener($event$payload);
  6.             }
  7.             return $listener(...array_values($payload));
  8.         };
  9.     }
  1.         }
  2.         $responses = [];
  3.         foreach ($this->getListeners($event) as $listener) {
  4.             $response $listener($event$payload);
  5.             // If a response is returned from the listener and event halting is enabled
  6.             // we will just return this response, and not call the rest of the event
  7.             // listeners. Otherwise we will add the response on the response list.
  8.             if ($halt && ! is_null($response)) {
  1.      * @param  \Illuminate\Contracts\View\View  $view
  2.      * @return void
  3.      */
  4.     public function callComposer(ViewContract $view)
  5.     {
  6.         $this->events->dispatch('composing: '.$view->name(), [$view]);
  7.     }
  8.     /**
  9.      * Call the creator for a given view.
  10.      *
  1.         // We will keep track of the number of views being rendered so we can flush
  2.         // the section after the complete rendering operation is done. This will
  3.         // clear out the sections for any separate views that may be rendered.
  4.         $this->factory->incrementRender();
  5.         $this->factory->callComposer($this);
  6.         $contents $this->getContents();
  7.         // Once we've finished rendering the view, we'll decrement the render count
  8.         // so that each section gets flushed out next time a view is created and
  1.      * @throws \Throwable
  2.      */
  3.     public function render(callable $callback null)
  4.     {
  5.         try {
  6.             $contents $this->renderContents();
  7.             $response = isset($callback) ? $callback($this$contents) : null;
  8.             // Once we have the contents of the view, we will flush the sections if we are
  9.             // done rendering all views so that there is nothing left hanging over when
  1.     <div id="app">
  2.       <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  3.     </div>
  4.   <?php else : ?>
  5.     <div id="app">
  6.       <?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
  7.     </div>
  8.   <?php endif; ?>
  9.   <?php do_action('get_footer'); ?>
  10.   <?php wp_footer(); ?>
include('/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/index.php') in /export/hosting/men/levelup/htdocs/wp-includes/template-loader.php (line 106)
  1.      *
  2.      * @param string $template The path of the template to include.
  3.      */
  4.     $template apply_filters'template_include'$template );
  5.     if ( $template ) {
  6.         include $template;
  7.     } elseif ( current_user_can'switch_themes' ) ) {
  8.         $theme wp_get_theme();
  9.         if ( $theme->errors() ) {
  10.             wp_die$theme->errors() );
  11.         }
require_once('/export/hosting/men/levelup/htdocs/wp-includes/template-loader.php') in /export/hosting/men/levelup/htdocs/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH WPINC '/template-loader.php';
  5. }
require('/export/hosting/men/levelup/htdocs/wp-blog-header.php') in /export/hosting/men/levelup/htdocs/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define'WP_USE_THEMES'true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Attempt to read property "post_parent" on null

  at /export/hosting/men/levelup/htdocs/wp-content/themes/levelup/app/View/Composers/App.php:78
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:49)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/app/View/Composers/App.php:78)
  at App\View\Composers\App->is_teachers_corner()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/app/View/Composers/App.php:29)
  at App\View\Composers\App->with()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:70)
  at Roots\Acorn\View\Composer->merge()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/roots/acorn/src/Roots/Acorn/View/Composer.php:59)
  at Roots\Acorn\View\Composer->compose()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/view/Concerns/ManagesEvents.php:124)
  at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/view/Concerns/ManagesEvents.php:162)
  at Illuminate\View\Factory->Illuminate\View\Concerns\{closure}()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/events/Dispatcher.php:418)
  at Illuminate\Events\Dispatcher->Illuminate\Events\{closure}()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/events/Dispatcher.php:249)
  at Illuminate\Events\Dispatcher->dispatch()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/view/Concerns/ManagesEvents.php:177)
  at Illuminate\View\Factory->callComposer()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/view/View.php:176)
  at Illuminate\View\View->renderContents()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/vendor/illuminate/view/View.php:147)
  at Illuminate\View\View->render()
     (/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/index.php:45)
  at include('/export/hosting/men/levelup/htdocs/wp-content/themes/levelup/index.php')
     (/export/hosting/men/levelup/htdocs/wp-includes/template-loader.php:106)
  at require_once('/export/hosting/men/levelup/htdocs/wp-includes/template-loader.php')
     (/export/hosting/men/levelup/htdocs/wp-blog-header.php:19)
  at require('/export/hosting/men/levelup/htdocs/wp-blog-header.php')
     (/export/hosting/men/levelup/htdocs/index.php:17)