Skip to content

Undefined variable $builderContent in Magento_Theme/templates/root.phtml

After upgrading to the latest Magento Release 2.4.4 using PHP 8.1 the website stops loading returning be

1 exception(s):
Exception #0 (Exception): Warning: Undefined variable $builderContent in /home/example/public_html/app/design/frontend/Mgs/claue/Magento_Theme/templates/root.phtml on line 57

Exception #0 (Exception): Warning: Undefined variable $builderContent in /home/example/public_html/app/design/frontend/Mgs/claue/Magento_Theme/templates/root.phtml on line 57
<pre>#1 include() called at [vendor/magento/framework/View/Result/Page.php:329]
#2 MagentoFrameworkViewResultPage->renderPage() called at [vendor/magento/framework/View/Result/Page.php:262]
#3 MagentoFrameworkViewResultPage->render() called at [vendor/magento/framework/View/Result/Layout.php:171]
#4 MagentoFrameworkViewResultLayout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#5 MGSMpanelBlockFrameworkPageInterceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#6 MGSMpanelBlockFrameworkPageInterceptor->MagentoFrameworkInterception{closure}() called at [app/code/MGS/ThemeSettings/Plugin/ResultInterfaceAfter.php:59]
#7 MGSThemeSettingsPluginResultInterfaceAfter->aroundRenderResult() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#8 MGSMpanelBlockFrameworkPageInterceptor->MagentoFrameworkInterception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#9 MGSMpanelBlockFrameworkPageInterceptor->___callPlugins() called at [generated/code/MGS/Mpanel/Block/Framework/Page/Interceptor.php:113]
#10 MGSMpanelBlockFrameworkPageInterceptor->renderResult() called at [vendor/magento/framework/App/Http.php:120]
#11 MagentoFrameworkAppHttp->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#12 MagentoFrameworkAppHttpInterceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#13 MagentoFrameworkAppBootstrap->run() called at [pub/index.php:30]
</pre>

I have removed cached and recompiled and reindexed and redeployed the Magento files and modules but the error still persists.

Remove the mentioned variable $builderContent that is loading the website but is not fully functional.