Title: PHP 8.2 causing error when using Event List widget
Last modified: September 3, 2024

---

# PHP 8.2 causing error when using Event List widget

 *  [netnothing](https://wordpress.org/support/users/netnothing/)
 * (@netnothing)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/)
 * 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.
 *     ```wp-block-code
       [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:29Stack 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 1 year, 8 months ago by [netnothing](https://wordpress.org/support/users/netnothing/).
    -  This topic was modified 1 year, 8 months ago by [netnothing](https://wordpress.org/support/users/netnothing/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Jes](https://wordpress.org/support/users/jescandoit/)
 * (@jescandoit)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-17993305)
 * Hi [@netnothing](https://wordpress.org/support/users/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](https://theeventscalendar.com/knowledgebase/k/testing-for-conflicts/)
   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](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](https://wordpress.org/support/users/netnothing/)
 * (@netnothing)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-17994620)
 * Hi [@jescandoit](https://wordpress.org/support/users/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 1 year, 8 months ago by [netnothing](https://wordpress.org/support/users/netnothing/).
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-17994986)
 * Hi [@netnothing](https://wordpress.org/support/users/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](https://wordpress.org/support/users/netnothing/)
 * (@netnothing)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-17994995)
 * WordPress 6.6.1
   The Events Calendar Version 6.6.3
 *  Thread Starter [netnothing](https://wordpress.org/support/users/netnothing/)
 * (@netnothing)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-17997164)
 * 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](https://wordpress.org/support/users/netnothing/)
 * (@netnothing)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-18006369)
 * Hello. Are there any updates on this?
 * Thanks!
 *  Plugin Support [WilloftheD](https://wordpress.org/support/users/abzlevelup/)
 * (@abzlevelup)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-18011353)
 * 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.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [WilloftheD](https://wordpress.org/support/users/abzlevelup/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/php-8-2-causing-error-when-using-event-list-widget/#post-18011353)
 * Status: not resolved