• After upgrading to PHP 8.2, we are noticing that overall it looks like the plugin is working fine. However, it is causing a fatal error only when we have the Event List widget active on the site.

    Listed below is the error. If we remove the widget, the site loads fine.

    [03-Sep-2024 16:50:47 UTC] PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #2 must be of type array, string given in /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/views/v2/components/messages.php:29
    Stack trace:
    #0 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/views/v2/components/messages.php(29): array_merge(Array, '')
    #1 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1062): include('/home/customer/...')
    #2 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(912): Tribe__Template->template_safe_include(NULL)
    #3 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/views/v2/widgets/widget-events-list.php(75): Tribe__Template->template(Array)
    #4 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1062): include('/home/customer/...')
    #5 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(912): Tribe__Template->template_safe_include(NULL)
    #6 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Template.php(71): Tribe__Template->template(Array, Array, false)
    #7 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/View.php(731): Tribe\Events\Views\V2\Template->render()
    #8 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Widgets/Widget_Abstract.php(134): Tribe\Events\Views\V2\View->get_html()
    #9 /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/common/src/Tribe/Widget/Widget_Abstract.php(307): Tribe\Events\Views\V2\Widgets\Widget_Abstract->get_html()
    #10 /home/customer/www/staging.clientsite.net/public_html/wp-includes/class-wp-widget.php(394): Tribe\Widget\Widget_Abstract->widget(Array, Array)
    #11 /home/customer/www/staging.clientsite.net/public_html/wp-includes/widgets.php(845): WP_Widget->display_callback(Array, Array)
    #12 /home/customer/www/staging.clientsite.net/public_html/wp-content/themes/betheme/footer.php(128): dynamic_sidebar('footer-area-3')
    #13 /home/customer/www/staging.clientsite.net/public_html/wp-includes/template.php(810): require_once('/home/customer/...')
    #14 /home/customer/www/staging.clientsite.net/public_html/wp-includes/template.php(745): load_template('/home/customer/...', true, Array)
    #15 /home/customer/www/staging.clientsite.net/public_html/wp-includes/general-template.php(92): locate_template(Array, true, true, Array)
    #16 /home/customer/www/staging.clientsite.net/public_html/wp-content/themes/betheme/page.php(78): get_footer()
    #17 /home/customer/www/staging.clientsite.net/public_html/wp-includes/template-loader.php(106): include('/home/customer/...')
    #18 /home/customer/www/staging.clientsite.net/public_html/wp-blog-header.php(19): require_once('/home/customer/...')
    #19 /home/customer/www/staging.clientsite.net/public_html/index.php(17): require('/home/customer/...')
    #20 {main}
    thrown in /home/customer/www/staging.clientsite.net/public_html/wp-content/plugins/the-events-calendar/src/views/v2/components/messages.php on line 29

    • This topic was modified 6 months, 3 weeks ago by netnothing.
    • This topic was modified 6 months, 3 weeks ago by netnothing.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Jes

    (@jescandoit)

    Hi @netnothing

    Thanks for reaching out.

    Based on the error report, the Event List widget might not be properly initialized on your end. Would you mind re-installing the Events Calendar plugin? Also, what was the previous PHP version before this issue surfaced? Does our plugin and your WordPress version are up-to-date?

    Also, it might be worth a shot to proceed with conflict testing for it. We just need to cross-out the possibility that this might be caused by your other plugin or the theme itself. As I was unable to replicate the issue using PHP 8.2.9 at the moment → https://share.zight.com/2Nuor94d

    Please keep us on the loop on how it goes, and we’re looking forward to solving this.

    Thread Starter netnothing

    (@netnothing)

    Hi @jescandoit thanks for getting back to me and the details, including the video.

    A couple of clarifications on my end. We are using the latest version of WP and using the theme BeTheme. I have done testing on my end, including turning off all plugins and switching to the base theme. Here is what I have found.

    • The prior version of PHP (7.4.33) does not have this problem.
    • The theme we are using uses the old widgets (Appearance -> Widgets) and we have the plugin Classic Widgets installed.

    What I have found that is causing the error on PHP 8.2.23:

    – If you add the Events List either as the old widget OR the new block editor widget
    – You have NO upcoming events, or in our case the only event listed has passed (Aug 31)
    – You are using PHP 8.2.23

    With the above in place, when the site tries to load that widget block, it throws the error I attached above and crashes the site layout.

    For now we can work around this by making sure we have a placeholder event in place that has an end date in the future.

    Hopefully this helps. This only impacts the widget, not the full page on PHP 8.2.23.

    • This reply was modified 6 months, 2 weeks ago by netnothing.
    Plugin Support Darian

    (@d0153)

    Hi @netnothing

    Could you also provide the version of The Events Calendar that you’re using? I want to check it further on my end.

    Looking forward to your reply.

    Thread Starter netnothing

    (@netnothing)

    WordPress 6.6.1
    The Events Calendar Version 6.6.3

    Thread Starter netnothing

    (@netnothing)

    Just wanted to share some more testing I have done on my side. This is definitely caused when you use, PHP 8.2, the Classic Widgets plugin and you add the Events Calendar widget to a sidebar/widget area. I’m guessing maybe that widget is different or using older code than when you are using the new widgets with the block editor?

    Steps to reproduce for me:

    • Run PHP 8.2.x
    • Don’t have any active events. If you have an active event with the current timeframe, things work just fine.
    • Have a theme that includes the old Appearance -> Widgets
    • Install and activate Classic Widgets plugin
    • Go to Appearance Widgets and add the Events List widget
    • The site will crash on load with the error: There has been a critical error on this website. With the error log from my first post

    However, if you do NOT activate the Classic Widgets plugin, and you add the Event List widget to the same area using the newer block widget editor, everything works as it should. No errors. In fact, after adding it – you can even re-enable the Classic Widget plugin and it will still work, as long as you don’t re-add the Event List widget in the classic widget screen.

    Thread Starter netnothing

    (@netnothing)

    Hello. Are there any updates on this?

    Thanks!

    Plugin Support Abz

    (@abzlevelup)

    Hope you’re doing good. Apologies for the delay here.

    Thank you for sharing your detailed testing results. This information is helpful and will narrow things down. Based on your findings, it appears that there is a compatibility issue between PHP 8.2, the Classic Widgets plugin, and our plugin. Yes could be that it is using old code and not compatible when used on the same page.

    Appreciate you sharing this workaround here:

    For now we can work around this by making sure we have a placeholder event in place that has an end date in the future.

    It seems like you’re using the classic widget for the sidebar, since you can add the Events Calendar widget directly using the block editor on the page. For now your workaround should work, or if you’re not using it for other plugins, would be great to deactivate the Classic Widgets Plugin temporarily.

    I’d share this with our team, and get back to you on this. Appreciate your patience here.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP 8.2 causing error when using Event List widget’ is closed to new replies.