strangerstudios / pmpro-roles

Adds a custom WordPress Role for each membership level in Paid Memberships Pro
https://www.paidmembershipspro.com/add-ons/pmpro-roles/
GNU General Public License v2.0
17 stars 16 forks source link

PHP 8.0.23 causes error #38

Closed michaelbeil closed 1 year ago

michaelbeil commented 2 years ago

Describe the bug A customer ran into an error with PHP 8.0.23.

To Reproduce Steps to reproduce the behavior on customer site:

  1. Activate Paid Memberships Pro, and Roles Add On
  2. Set PHP version to PHP 8.0 or higher, see the following error in query monitor:

Fatal error: Uncaught Error: array_merge(): Argument #1 must be of type array, string given in /var/web/site/public_html/wp-content/plugins/paid-memberships-pro/includes/content.php on line 228

Call stack:

array_merge() wp-content/plugins/paid-memberships-pro/includes/content.php:228 pmpro_search_filter() wp-includes/class-wp-hook.php:307 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:524 do_action_ref_array() wp-includes/class-wp-query.php:1805 WP_Query::get_posts() wp-includes/class-wp-query.php:3586 WP_Query::query() wp-includes/class-wp-query.php:3718 WP_Query::__construct() wp-content/plugins/molongui-authorship/includes/helpers/common/cache.php:47 molongui_query() wp-content/plugins/molongui-authorship/includes/author.php:652 Molongui\A\I\Author::get_posts() wp-content/plugins/molongui-authorship/includes/hooks/guest/edit.php:114 authorship_guest_delete() wp-includes/class-wp-hook.php:309 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:476 do_action() wp-includes/post.php:3443 wp_delete_post() wp-content/plugins/wp-hummingbird/core/modules/minify/class-minify-group.php:1407 Hummingbird\C\M\M\Minify_Group::delete_file() wp-content/plugins/wp-hummingbird/core/modules/minify/class-minify-groups-list.php:324 Hummingbird\C\M\M\Minify_Groups_List::preprocess_groups() wp-content/plugins/wp-hummingbird/core/modules/class-minify.php:401 Hummingbird\C\M\Minify::filter_enqueues_list() wp-content/plugins/wp-hummingbird/core/modules/class-minify.php:270 Hummingbird\C\M\Minify::filter_scripts() wp-includes/class-wp-hook.php:307 WP_Hook::apply_filters() wp-includes/plugin.php:191 apply_filters() wp-includes/class.wp-scripts.php:650 WP_Scripts::all_deps() wp-includes/class.wp-dependencies.php:126 WP_Dependencies::do_items() wp-includes/class.wp-scripts.php:679 WP_Scripts::do_footer_items() wp-includes/script-loader.php:2030 print_footer_scripts() wp-includes/script-loader.php:2125 _wp_footer_scripts() wp-includes/class-wp-hook.php:307 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:476 do_action() wp-includes/script-loader.php:2139 wp_print_footer_scripts() wp-includes/class-wp-hook.php:307 WP_Hook::apply_filters() wp-includes/class-wp-hook.php:331 WP_Hook::do_action() wp-includes/plugin.php:476 do_action() wp-includes/general-template.php:3058 wp_footer() wp-content/themes/astra/footer.php:33 require_once() wp-includes/template.php:770 load_template() wp-includes/template.php:716 locate_template() wp-includes/general-template.php:92 get_footer() wp-content/themes/astra/page.php:44 include() wp-includes/template-loader.php:106 require_once() wp-blog-header.php:19 require() index.php:17

Expected behavior There should not be an error.

Isolating the problem:

This came up in ticket 450021, but I have not been able to replicate this.

WordPress Environment

Paid Memberships Pro 2.9.5, Roles Add On 1.4.1, WordPress 6.0.2, PHP 8.0.23
andrewlimaza commented 1 year ago

I am unable to replicate this and the issue shared is unrelated to PMPro Roles, as the error is coming from PMPro Content.php page.

Specifically here: https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/content.php#L228

The customer mentioned that there was a fatal error of "PMPRO_VERSION" being undefined which has been resolved and scheduled for release. I am going to close this as it seems inconclusive and site specific. If the issue persists, please create a new issue and let us know how to replicate it.