Upgrade 5.1.5 > 6.0 rc1 resulted in fatal error

Hello,

TL;DR
When upgraded from 5.1.5 to 6.0rc1 site basically broken.

Main page is not rendering properly, only errors are thrown. Secondary pages are displayed with plus or minus the same errors, content of the pages are visible tho but without any formatting.

New pages could not be created/edited with Cornerstone as well as existing, see last screenshot.

At first I though that it is related to child theme (since there no child theme for 6.x version and I’m using some custom functions and things in functions.php). But it is exactly the same with main theme active without child.

Conditions:
Everything works in production with 5.1.5 & PHP 8.0.

Upgrade was done locally (backup restore, theme upgrade with ZIP archive).
Local setup has PHP 8.1.
WP version is 6.1.1 in production and on local dev.
All unrelated plugins were disabled or deleted.

Loops, conditions and templates are actively used throughout the site (if that’s important).

Frontend: Errors thrown on one of the pages

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Themeco\Cornerstone\Util\ConditionRules::expression_number_eq(), 1 passed and exactly 2 expected in /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Util/ConditionRules.php:421 Stack trace: #0 [internal function]: Themeco\Cornerstone\Util\ConditionRules::expression_number_eq(‘1’) #1 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/RuleMatching.php(57): call_user_func_array(Array, Array) #2 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/RuleMatching.php(66): Themeco\Cornerstone\Services\RuleMatching->evaluate(Array) #3 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/RuleMatching.php(81): Themeco\Cornerstone\Services\RuleMatching->matchRuleGroup(Array) #4 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/RuleMatching.php(106): Themeco\Cornerstone\Services\RuleMatching->match(Array) #5 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(276): Themeco\Cornerstone\Services\RuleMatching->shouldHideElement(Array) #6 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(132): Themeco\Cornerstone\Elements\Renderer->renderWithLoopers(Array) #7 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(65): Themeco\Cornerstone\Elements\Renderer->renderElement(Array) #8 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Elements.php(470): Themeco\Cornerstone\Elements\Renderer->renderElements(Array, NULL) #9 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Elements.php(466): Themeco\Cornerstone\Services\Elements->renderElements(Array) #10 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(177): Themeco\Cornerstone\Services\Elements->directRender(Array) #11 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(293): Themeco\Cornerstone\Elements\Renderer->render_one(Array) #12 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(132): Themeco\Cornerstone\Elements\Renderer->renderWithLoopers(Array) #13 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Elements/Renderer.php(65): Themeco\Cornerstone\Elements\Renderer->renderElement(Array) #14 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Elements.php(470): Themeco\Cornerstone\Elements\Renderer->renderElements(Array, NULL) #15 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Resolver.php(375): Themeco\Cornerstone\Services\Elements->renderElements(Array) #16 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Resolver.php(368): Themeco\Cornerstone\Services\Resolver->renderScoped(Array, Object(Themeco\Cornerstone\Documents\Content)) #17 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Resolver.php(315): Themeco\Cornerstone\Services\Resolver->renderDocument(Object(Themeco\Cornerstone\Documents\Content)) #18 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Resolver.php(299): Themeco\Cornerstone\Services\Resolver->Themeco\Cornerstone\Services{closure}() #19 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/Resolver.php(321): Themeco\Cornerstone\Services\Resolver->safeDocRender(Object(Themeco\Cornerstone\Documents\Content), Object(Closure)) #20 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/FrontEnd.php(121): Themeco\Cornerstone\Services\Resolver->renderContentFromDocument(Object(Themeco\Cornerstone\Documents\Content)) #21 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Services/FrontEnd.php(83): Themeco\Cornerstone\Services\FrontEnd->render_the_content_cached(30, ‘[cs_element_sec…’) #22 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/shortcodes.php(355): Themeco\Cornerstone\Services\FrontEnd->render_content(’’, ‘[cs_element_sec…’, ‘cs_content’) #23 [internal function]: do_shortcode_tag(Array) #24 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/shortcodes.php(227): preg_replace_callback(’/\[(\[?)(cs_con…’, ‘do_shortcode_ta…’, ‘[cs_content][cs…’) #25 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/class-wp-hook.php(308): do_shortcode(’[cs_content][cs…’) #26 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(’[cs_content][cs…’, Array) #27 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/post-template.php(255): apply_filters(‘the_content’, ‘[cs_content][cs…’) #28 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/views/global/_content-the-content.php(17): the_content() #29 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/legacy/functions/frontend/view-routing.php(36): include(’/Users/redacted…’) #30 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/legacy/functions/frontend/view-routing.php(77): x_render_view(’/Users/redacted…’, Array, true) #31 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/views/integrity/template-blank-4.php(18): x_get_view(‘global’, ‘_content’, ‘the-content’) #32 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/legacy/functions/frontend/view-routing.php(36): include(’/Users/redacted…’) #33 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/legacy/functions/frontend/view-routing.php(77): x_render_view(’/Users/redacted…’, Array, true) #34 /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/framework/legacy/templates/template-blank-4.php(15): x_get_view(‘integrity’, ‘template’, ‘blank-4’) #35 /Users/redacted/Developer/WordPress/redacted/app/public/wp-includes/template-loader.php(106): include(’/Users/redacted…’) #36 /Users/redacted/Developer/WordPress/redacted/app/public/wp-blog-header.php(19): require_once(’/Users/redacted…’) #37 /Users/redacted/Developer/WordPress/redacted/app/public/index.php(17): require(’/Users/redacted…’) #38 {main} thrown in /Users/redacted/Developer/WordPress/redacted/app/public/wp-content/themes/pro/cornerstone/includes/classes/Util/ConditionRules.php on line 421

Frontend: Example of how secondary page looks like

Backend: no pages can be opened in the editor


Is it expected and will be fixed later?
If not can I help you to understand what’s going on? By sharing more info or creating a tunnel to my local env so you can inspect things there?

1 Like

I can remove the possibility of a fatal error there. This is probably 8.1 related. However I’m afraid you might have lost some conditions. Could you check you still have those? If they are gone could you send me an XML export of either the pro 5 site or after the pro 6 upgrade?
If your conditions are still here it’s no big deal just a null coalescence on my end.

After a brief inspection of elements in outline it seems that all conditions are in place. I could miss some but it’s not likely.

I switched PHP from 8.1 to 8.0.22 just to check. Unfortunately same errors are thrown.

Do you want an XML anyway? Or any other debug/dump info?

If your conditions are still there we are fine it’s just a PHP 8 issue. This will be fixed in the next release. Contact us if you have any issues. Thanks have a great day!

1 Like