• Resolved PCS Web Hosting LLC

    (@wetapplemedia)


    Simple Calendar 3.1.36 has PHP 8.2.0 Fatal Error:

    [Mon Dec 12 06:05:11.902044 2022] [fcgid:warn] mod_fcgid: stderr: PHP Fatal error:  Uncaught TypeError: SimpleCalendar\\plugin_deps\\Carbon\\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /wp-content/plugins/google-calendar-events/third-party/nesbot/carbon/src/Carbon/Traits/Creator.php on line 81 and defined in /wp-content/plugins/google-calendar-events/third-party/nesbot/carbon/src/Carbon/Traits/Creator.php:674
    [Mon Dec 12 06:05:11.902111 2022] [fcgid:warn] mod_fcgid: stderr: Stack trace:
    [Mon Dec 12 06:05:11.902117 2022] [fcgid:warn] mod_fcgid: stderr: #0 /wp-content/plugins/google-calendar-events/third-party/nesbot/carbon/src/Carbon/Traits/Creator.php(81): SimpleCalendar\\plugin_deps\\Carbon\\Carbon::setLastErrors()
    [Mon Dec 12 06:05:11.902122 2022] [fcgid:warn] mod_fcgid: stderr: #1 /wp-content/plugins/google-calendar-events/third-party/nesbot/carbon/src/Carbon/Traits/Creator.php(212): SimpleCalendar\\plugin_deps\\Carbon\\Carbon->__construct()
    [Mon Dec 12 06:05:11.902138 2022] [fcgid:warn] mod_fcgid: stderr: #2 /wp-content/plugins/google-calendar-events/includes/functions/shared.php(241): SimpleCalendar\\plugin_deps\\Carbon\\Carbon::now()
    [Mon Dec 12 06:05:11.902143 2022] [fcgid:warn] mod_fcgid: stderr: #3 /wp-content/plugins/google-calendar-events/includes/functions/shared.php(166): simcal_get_calendar_names_i18n()
    [Mon Dec 12 06:05:11.902147 2022] [fcgid:warn] mod_fcgid: stderr: #4 /wp-content/plugins/google-calendar-events/includes/calendars/views/default-calendar-grid.php(143): simcal_common_scripts_variables()
    [Mon Dec 12 06:05:11.902152 2022] [fcgid:warn] mod_fcgid: stderr: #5 /wp-content/plugins/google-calendar-events/includes/assets.php(126): SimpleCalendar\\Calendars\\Views\\Default_Calendar_Grid->scripts()
    [Mon Dec 12 06:05:11.902156 2022] [fcgid:warn] mod_fcgid: stderr: #6 /wp-includes/class-wp-hook.php(308): SimpleCalendar\\Assets->load()
    [Mon Dec 12 06:05:11.902160 2022] [fcgid:warn] mod_fcgid: stderr: #7 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    [Mon Dec 12 06:05:11.902164 2022] [fcgid:warn] mod_fcgid: stderr: #8 /wp-includes/plugin.php(517): WP_Hook->do_action()
    [Mon Dec 12 06:05:11.902168 2022] [fcgid:warn] mod_fcgid: stderr: #9 /wp-includes/script-loader.php(2180): do_action()
    [Mon Dec 12 06:05:11.902172 2022] [fcgid:warn] mod_fcgid: stderr: #10 /wp-includes/class-wp-hook.php(308): wp_enqueue_scripts()
    [Mon Dec 12 06:05:11.902177 2022] [fcgid:warn] mod_fcgid: stderr: #11 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    [Mon Dec 12 06:05:11.902181 2022] [fcgid:warn] mod_fcgid: stderr: #12 /wp-includes/plugin.php(517): WP_Hook->do_action()
    [Mon Dec 12 06:05:11.902185 2022] [fcgid:warn] mod_fcgid: stderr: #13 /wp-includes/general-template.php(3043): do_action()
    [Mon Dec 12 06:05:11.902189 2022] [fcgid:warn] mod_fcgid: stderr: #14 /wp-content/themes/wshg/header.php(20): wp_head()
    [Mon Dec 12 06:05:11.902193 2022] [fcgid:warn] mod_fcgid: stderr: #15 /wp-includes/template.php(783): require_once('...')
    [Mon Dec 12 06:05:11.902197 2022] [fcgid:warn] mod_fcgid: stderr: #16 /wp-includes/template.php(718): load_template()
    [Mon Dec 12 06:05:11.902202 2022] [fcgid:warn] mod_fcgid: stderr: #17 /wp-includes/general-template.php(48): locate_template()
    [Mon Dec 12 06:05:11.902206 2022] [fcgid:warn] mod_fcgid: stderr: #18 /wp-content/themes/wshg/index.php(13): get_header()
    [Mon Dec 12 06:05:11.902211 2022] [fcgid:warn] mod_fcgid: stderr: #19 /wp-includes/template-loader.php(106): include('...')
    [Mon Dec 12 06:05:11.902246 2022] [fcgid:warn] mod_fcgid: stderr: #20 /wp-blog-header.php(19): require_once('...')
    [Mon Dec 12 06:05:11.902250 2022] [fcgid:warn] mod_fcgid: stderr: #21 /index.php(17): require('...')
    [Mon Dec 12 06:05:11.902254 2022] [fcgid:warn] mod_fcgid: stderr: #22 {main}
    [Mon Dec 12 06:05:11.902258 2022] [fcgid:warn] mod_fcgid: stderr:   thrown in /wp-content/plugins/google-calendar-events/third-party/nesbot/carbon/src/Carbon/Traits/Creator.php on line 674
Viewing 11 replies - 16 through 26 (of 26 total)
  • Fails for me too @ 3.1.37.2, PHP 8.2:

    Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in /wp-content/plugins/google-calendar-events/includes/assets.php:178 

    Plugin Author Rohit Singhal

    (@rosinghal)

    @ivantipov are you using latest version? We have pushed fix recently which makes it compatible with PHP 8.2.

    @rosinghal thank you – as mentioned, it’s on 3.1.37.2, fails on both localhost and staging.

    Hi @rosinghal, @johnweru,

    Any update on this error? Breaking on PHP 8+ only, 7.4 works fine. Only reason I can’t upgrade the entire server to PHP 8.

    Just debugged and found the cause – using

    add_filter('simcal_front_end_scripts', '__return_null');

    in the theme – changing it to

    add_filter('simcal_front_end_scripts', '__return_empty_array');

    worked. There should be a check for the data type in the plugin, otherwise works fine.

    Plugin Support john

    (@johnweru)

    Hi there,

    Sorry about the error.

    In this case, please update the plugin to the latest version and check whether the issue is resolved.

    Let us know how it goes.

    Kind Regards

    Plugin Author Rohit Singhal

    (@rosinghal)

    @johnweru I haven’t looked at this on the latest release.

    @ivantipov was the issue local to your website since you had added add_filter('simcal_front_end_scripts', '__return_null'); previously?

    Ivan Antipov

    (@ivantipov)

    @rosinghal Yes – changing to add_filter('simcal_front_end_scripts', '__return_empty_array');worked, however you should also add a type check there.

    Plugin Author Rohit Singhal

    (@rosinghal)

    @ivantipov thanks for letting me know. Can you provide a reference on how can this be done?

    Ivan Antipov

    (@ivantipov)

    Quite simply, change /includes/assets.php:178 to

    if ( is_array( $scripts ) ) {
    return array_merge( $scripts, $view->scripts( $min ) );
    } else {
    return $view->scripts( $min );
    }

    or similar – untested.

    Plugin Author Rohit Singhal

    (@rosinghal)

    Ah, got it. Created a PR for the same https://github.com/Xtendify/Simple-Calendar/pull/398.

Viewing 11 replies - 16 through 26 (of 26 total)

The topic ‘Simple Calendar 3.1.36 has PHP 8.2.0 Fatal Error’ is closed to new replies.