strangerstudios / sitewide-sales

Run Black Friday, Cyber Monday, or other flash sales on your WordPress-powered eCommerce or membership site with WooCommerce, Easy Digital Downloads, and Paid Memberships Pro.
https://sitewidesales.com
GNU General Public License v3.0
3 stars 6 forks source link

An error of type E_ERROR on PHP 8 #142

Closed michaelbeil closed 1 year ago

michaelbeil commented 1 year ago

Describe the bug A customer ran into an error on PHP 8.

To Reproduce Steps to reproduce the behavior for customer:

  1. Set PHP version to PHP 8
  2. Activate Paid Memberships Pro and Sitewide Sales Add On. See this error:
Error Details
==============
An error of type E_ERROR was caused in line 183 of the file /srv/htdocs/wp-content/plugins/pmpro-sitewide-sales/includes/classes/class-pmpro-sws-setup.php verursacht. Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /srv/htdocs/wp-content/plugins/pmpro-sitewide-sales/includes/classes/class-pmpro-sws-setup.php:183
Stack trace:
#0 /srv/htdocs/wp-content/plugins/pmpro-sitewide-sales/includes/classes/class-pmpro-sws-setup.php(183): array_merge(NULL, Array)
#1 /wordpress/core/6.2/wp-includes/class-wp-hook.php(310): PMPro_Sitewide_Sales\includes\classes\PMPro_SWS_Setup::pmpro_sws_plugin_action_links(Array)
#2 /wordpress/core/6.2/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)
#3 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php(384): apply_filters(‘plugin_action_l…’, Array, ‘pmpro-sitewide-…’, NULL, ‘all’)
#4 /wordpress/core/6.2/wp-includes/class-wp-hook.php(308): Automattic\Jetpack\Sync\Modules\Callables->set_plugin_action_links(Object(WP_Screen))
#5 /wordpress/core/6.2/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#6 /wordpress/core/6.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /wordpress/core/6.2/wp-admin/includes/class-wp-screen.php(424): do_action(‘current_screen’, Object(WP_Screen))
#8 /wordpress/core/6.2/wp-admin/includes/screen.php(243): WP_Screen->set_current_screen()
#9 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(505): set_current_screen(‘sync’)
#10 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(601): Automattic\Jetpack\Sync\Sender->get_items_to_send(Object(Automattic\Jetpack\Sync\Queue_Buffer), true)
#11 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(462): Automattic\Jetpack\Sync\Sender->do_sync_for_queue(Object(Automattic\Jetpack\Sync\Queue))
#12 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-sender.php(341): Automattic\Jetpack\Sync\Sender->do_sync_and_set_delays(Object(Automattic\Jetpack\Sync\Queue))
#13 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(704): Automattic\Jetpack\Sync\Sender->do_sync()
#14 /wordpress/plugins/jetpack/12.1-a.5/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(644): Automattic\Jetpack\Sync\Actions::do_cron_sync_by_type(‘sync’)
#15 /wordpress/core/6.2/wp-includes/class-wp-hook.php(308): Automattic\Jetpack\Sync\Actions::do_cron_sync()
#16 /wordpress/core/6.2/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#17 /wordpress/core/6.2/wp-includes/ plugin.php(565): WP_Hook->do_action(Array)
#18 /wordpress/core/6.2/wp-cron.php(188): do_action_ref_array(‘jetpack_sync_cr…’, Array)
#19 {main}

There should not be an error.

Isolating the problem:

This came up in ticket 481014 on PHP 8.0.28, but I am not seeing any immediate email error with PHP 8.0.22, or 8.1.9.

WordPress Environment

Paid Memberships Pro 2.10.1, Sitewide Sales Add On 1.2.5, WordPress 6.2, PHP 8.0.28
andrewlimaza commented 1 year ago

This is an issue with https://github.com/strangerstudios/pmpro-sitewide-sales (which is deprecated) and the Series Add On