Wordpress error on WPEngine upgrade to PHP 7.2

Getting the following error on latest X theme on WPEngine when we upgrade to PHP 7.2, it’s fine on PHP 7.0

X Theme 6.4.6 / X Child theme 1.0.1
Wordpress 5.0.3
Cornerstone 3.4.6

Error code in WP Enging error logs seems to point to an issue with X Theme and would be great to know if this has been seen before:

The site eventually loads but with the X styling corrupted so keen to resolve this.

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function add_category_to_single(), 1 passed and exactly 2 expected in /nas/content/live/pdllc1/wp-content/themes/x-child/functions.php:54\nStack trace:\n#0 [internal function]: add_category_to_single(Array)\n#1 /nas/content/live/pdllc1/wp-includes/class-wp-hook.php(288): call_user_func_array(‘add_category_to…’, Array)\n#2 /nas/content/live/pdllc1/wp-includes/plugin.php(203): WP_Hook->apply_filters(Array, Array)\n#3 /nas/content/live/pdllc1/wp-includes/post-template.php(770): apply_filters(‘body_class’, Array, Array)\n#4 /nas/content/live/pdllc1/wp-includes/post-template.php(557): get_body_class(Array)\n#5 /nas/content/live/pdllc1/wp-content/themes/x-child/framework/views/global/_header.php(9): body_class()\n#6 /nas/content/live/pdllc1/wp-content/themes/x/framework/functions/frontend/view-routing.php(182): include(’/nas/content/li…’)\n#7 /nas/content/live/pdllc1/wp-content/themes/x/framework/functions/frontend/view-routing.php(55): X_View_Router::render(’/nas/conten in /nas/content/live/pdllc1/wp-content/themes/x-child/functions.php on line 54

Hi Panache,

Thanks for writing in! Those errors seems to be related to your child theme customizations. Could you please try disabling your child theme temporarily by activating your parent X theme and see if you’re getting the same error.

If the issue is resolved, then you need to check your child theme customizations.

Let us know how it goes.
Thanks!

Hi same problem with main theme with child theme deactivated

Hi Panache,

I see that you have a caching plugin for example Autooptimize. Did you clear full cache and test when you have disabled your child theme ? If not, follow this resource on how to clear full cache and re-test your issue again (https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/).

To further narrow down your issue, I would suggest you to disable your 3rd party plugins as well and re-test your issue further.

Also make sure that you’re using the latest version of WordPress core as well. You can see the latest version number from here (https://wordpress.org/download/) and update accordingly (https://codex.wordpress.org/Upgrading_WordPress).

If you’re still having issues, provide us with your WordPress login credentials along with your FTP credentials in a secure note to check your issue further.

Let us know how it goes.
Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.