Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Trying to get property 'post_type' of non-object

Exception

ErrorException

  1.         if(isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'ical')
  2.         {
  3.             $id sanitize_text_field($_GET['id']);
  4.             $post get_post($id);
  5.             if($post->post_type == $this->get_main_post_type() and $post->post_status == 'publish')
  6.             {
  7.                 $occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : '';
  8.                 $events $this->ical_single($id$occurrence);
  9.                 $ical_calendar $this->ical_calendar($events);
  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.         if(isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'ical')
  2.         {
  3.             $id sanitize_text_field($_GET['id']);
  4.             $post get_post($id);
  5.             if($post->post_type == $this->get_main_post_type() and $post->post_status == 'publish')
  6.             {
  7.                 $occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : '';
  8.                 $events $this->ical_single($id$occurrence);
  9.                 $ical_calendar $this->ical_calendar($events);
  1.                 // Avoid the array_slice() if possible.
  2.                 if ( == $the_['accepted_args'] ) {
  3.                     $value call_user_func$the_['function'] );
  4.                 } elseif ( $the_['accepted_args'] >= $num_args ) {
  5.                     $value call_user_func_array$the_['function'], $args );
  6.                 } else {
  7.                     $value call_user_func_array$the_['function'], array_slice$args0, (int) $the_['accepted_args'] ) );
  8.                 }
  9.             }
  10.         } while ( false !== next$this->iterations$nesting_level ] ) );
  1.      *
  2.      * @param array $args Parameters to pass to the callback functions.
  3.      */
  4.     public function do_action$args ) {
  5.         $this->doing_action true;
  6.         $this->apply_filters''$args );
  7.         // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
  8.         if ( ! $this->nesting_level ) {
  9.             $this->doing_action false;
  10.         }
  1.     } elseif ( is_array$arg[0] ) && === count$arg[0] ) && isset( $arg[0][0] ) && is_object$arg[0][0] ) ) {
  2.         // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
  3.         $arg[0] = $arg[0][0];
  4.     }
  5.     $wp_filter$hook_name ]->do_action$arg );
  6.     array_pop$wp_current_filter );
  7. }
  8. /**
  1.  *
  2.  * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
  3.  *
  4.  * @since 1.5.0
  5.  */
  6. do_action'init' );
  7. // Check site status.
  8. if ( is_multisite() ) {
  9.     $file ms_site_check();
  10.     if ( true !== $file ) {
require_once('/web-sites/ppl/multisite/web/wp/wp-settings.php') in /web-sites/ppl/multisite/web/wp-config.php (line 9)
  1.  * This file is required in the root directory so WordPress can find it.
  2.  * WP is hardcoded to look in its own directory or one directory up for wp-config.php.
  3.  */
  4. require_once dirname(__DIR__) . '/vendor/autoload.php';
  5. require_once dirname(__DIR__) . '/config/application.php';
  6. require_once ABSPATH 'wp-settings.php';
  7. error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_WARNING));
require_once('/web-sites/ppl/multisite/web/wp-config.php') in /web-sites/ppl/multisite/web/wp/wp-load.php (line 55)
  1.     require_once ABSPATH 'wp-config.php';
  2. } elseif ( @file_existsdirnameABSPATH ) . '/wp-config.php' ) && ! @file_existsdirnameABSPATH ) . '/wp-settings.php' ) ) {
  3.     /** The config file resides one level above ABSPATH but is not part of another installation */
  4.     require_once dirnameABSPATH ) . '/wp-config.php';
  5. } else {
  6.     // A config file doesn't exist.
require_once('/web-sites/ppl/multisite/web/wp/wp-load.php') in /web-sites/ppl/multisite/web/wp/wp-blog-header.php (line 13)
  1. if ( ! isset( $wp_did_header ) ) {
  2.     $wp_did_header true;
  3.     // Load the WordPress library.
  4.     require_once __DIR__ '/wp-load.php';
  5.     // Set up the WordPress query.
  6.     wp();
  7.     // Load the theme template.
require('/web-sites/ppl/multisite/web/wp/wp-blog-header.php') in /web-sites/ppl/multisite/web/index.php (line 6)
  1. <?php
  2. /**
  3.  * WordPress View Bootstrapper
  4.  */
  5. define('WP_USE_THEMES'true);
  6. require __DIR__ '/wp/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Trying to get property 'post_type' of non-object

  at /web-sites/ppl/multisite/web/app/plugins/modern-events-calendar/app/libraries/main.php:3583
  at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
     (/web-sites/ppl/multisite/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:54)
  at Roots\Acorn\Bootstrap\HandleExceptions->handleError()
     (/web-sites/ppl/multisite/web/app/plugins/modern-events-calendar/app/libraries/main.php:3583)
  at MEC_main->ical()
     (/web-sites/ppl/multisite/web/wp/wp-includes/class-wp-hook.php:310)
  at WP_Hook->apply_filters()
     (/web-sites/ppl/multisite/web/wp/wp-includes/class-wp-hook.php:334)
  at WP_Hook->do_action()
     (/web-sites/ppl/multisite/web/wp/wp-includes/plugin.php:517)
  at do_action()
     (/web-sites/ppl/multisite/web/wp/wp-settings.php:632)
  at require_once('/web-sites/ppl/multisite/web/wp/wp-settings.php')
     (/web-sites/ppl/multisite/web/wp-config.php:9)
  at require_once('/web-sites/ppl/multisite/web/wp-config.php')
     (/web-sites/ppl/multisite/web/wp/wp-load.php:55)
  at require_once('/web-sites/ppl/multisite/web/wp/wp-load.php')
     (/web-sites/ppl/multisite/web/wp/wp-blog-header.php:13)
  at require('/web-sites/ppl/multisite/web/wp/wp-blog-header.php')
     (/web-sites/ppl/multisite/web/index.php:6)