• Resolved jredfearnsd

    (@jredfearnsd)


    I understand that PHP 8.2 support for The Events Calendar plugin, and assuming The Events Calendar PRO plugin, is still in progress, so this is more of an attempt to get a bug ticket out in the open.

    The site I’m working on is on WPEngine, which is forcing sites on PHP 8.0 to be updated to 8.2 by late October. Below is the fatal error that occurs when the site was upgraded to 8.2:

    [29-Sep-2023 17:07:26 UTC] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Section.php:213
    Stack trace:
    #0 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(308): Tribe__Events__Pro__Customizer__Section->filter_settings(Array, NULL)
    #1 /nas/content/live/mytestsite/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
    #2 /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Main.php(174): apply_filters('tribe_events_pr...', Array, NULL)
    #3 /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Main.php(203): Tribe__Events__Pro__Customizer__Main->get_option()
    #4 /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Section_Day_List_View.php(35): Tribe__Events__Pro__Customizer__Main->has_option('day_list_view', 'price_bg_color')
    #5 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(308): Tribe__Events__Pro__Customizer__Section_Day_List_View->get_css_template('')
    #6 /nas/content/live/mytestsite/wp-includes/plugin.php(205): WP_Hook->apply_filters('', Array)
    #7 /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Main.php(235): apply_filters('tribe_events_pr...', '')
    #8 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(308): Tribe__Events__Pro__Customizer__Main->print_css_template('')
    #9 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    #10 /nas/content/live/mytestsite/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #11 /nas/content/live/mytestsite/wp-includes/script-loader.php(2177): do_action('wp_print_footer...')
    #12 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(308): wp_print_footer_scripts('')
    #13 /nas/content/live/mytestsite/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    #14 /nas/content/live/mytestsite/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    #15 /nas/content/live/mytestsite/wp-includes/general-template.php(3065): do_action('wp_footer')
    #16 /nas/content/live/mytestsite/wp-content/themes/nic/footer.php(63): wp_footer()
    #17 /nas/content/live/mytestsite/wp-includes/template.php(783): require_once('/nas/content/li...')
    #18 /nas/content/live/mytestsite/wp-includes/template.php(718): load_template('/nas/content/li...', true, Array)
    #19 /nas/content/live/mytestsite/wp-includes/general-template.php(92): locate_template(Array, true, true, Array)
    #20 /nas/content/live/mytestsite/wp-content/themes/nic/front-page.php(93): get_footer()
    #21 /nas/content/live/mytestsite/wp-includes/template-loader.php(106): include('/nas/content/li...')
    #22 /nas/content/live/mytestsite/wp-blog-header.php(19): require_once('/nas/content/li...')
    #23 /nas/content/live/mytestsite/index.php(17): require('/nas/content/li...')
    #24 {main}
      thrown in /nas/content/live/mytestsite/wp-content/plugins/events-calendar-pro/src/Tribe/Customizer/Section.php on line 213

    The fatal error occurs even when all unnecessary plugins are deactivated, and the theme is changed to a stock WP theme.

    This is the code block that is causing the fatal error:

    if ( count( $search ) === 1 ) { //this is line 213
       $settings = $this->create_ghost_settings( $settings );
    } else {
       $settings[ $this->ID ] = $this->create_ghost_settings( $settings[ $this->ID ] );
    }

    I added a is_null() check in the filter_settings function, and this – naturally – prevented the null value from causing the fatal error. I believe something like this will need to be put in place somewhere in the filter_settings function, to prevent the assumption that $search contains data.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darian

    (@d0153)

    Hi @jredfearnsd

    Thanks for reaching out.

    I was checking this particular file (based on your error logs) but could not find it on my side.

    events-calendar-pro/src/Tribe/Customizer/Section.php

    Could I ask for the version of The Events Calendar and Events Calendar PRO you’re using? Also, the steps on how we could replicate the issue as well. I want to check it further on my side.

    Moreover, I could not access the staging site you provided. It is asking for credentials before I can view the page.

    If disabling the restriction is impossible, please open a Support Ticket on our Help Desk since you have an active license with us. This is also to follow WordPress Forum Guidelines regarding premium users.

    Please do not share any credentials; this is for us to follow the WordPress Forum Guidelines.

    Plugin Support Darian

    (@d0153)

    Hi @jredfearnsd

    We haven’t heard back from you in a while, so I assume the matter has been resolved. If you need any more help, feel free to open a?Support Ticket?on our Help Desk, and we’ll be happy to assist you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The Events Calendar PRO – PHP 8.2 Fatal Error’ is closed to new replies.