C clokers Lv.5 Bronze Member Iron Member NullPro Lover Joined Oct 18, 2020 Messages 116 Reaction score 565 Credits $186 May 10, 2025 #41 I get this error when update new version 4.1.0 Exception #0 (Exception): Warning: Undefined variable $headCritical in app/design/frontend/MageBig/martfury/layout01/Magento_Theme/templates/root.phtml on line 12 Click to expand... the new variables in the root.phtml file all give me the same error. PHP: [QUOTE] <?= /* @noEscape */ $headCritical ?> <?= /* @noEscape */ $headAssets ?> [/QUOTE] If I delete them, it works. Does anyone know why and how I can fix them? i use Magento ver. 2.4.7-p5 Checking in the vendor/magento/module-theme/view/base/templates/root.phtml file there are no these two variables, so I think it is only for version of magento 2.4.8. Magento 2.4.8 https://github.com/magento/magento2/blob/2.4.8/app/code/Magento/Theme/view/base/templates/root.phtml Magento 2.4.7-p5 https://github.com/magento/magento2.../Magento/Theme/view/base/templates/root.phtml you can solve the problem with an if PHP: <?php if(isset($headCritical)): ?> <?= /* @noEscape */ $headCritical ?> <?php endif; ?> <?php if(isset($headAssets)): ?> <?= /* @noEscape */ $headAssets ?> <?php endif; ?> Last edited by a moderator: May 10, 2025
I get this error when update new version 4.1.0 Exception #0 (Exception): Warning: Undefined variable $headCritical in app/design/frontend/MageBig/martfury/layout01/Magento_Theme/templates/root.phtml on line 12 Click to expand... the new variables in the root.phtml file all give me the same error. PHP: [QUOTE] <?= /* @noEscape */ $headCritical ?> <?= /* @noEscape */ $headAssets ?> [/QUOTE] If I delete them, it works. Does anyone know why and how I can fix them? i use Magento ver. 2.4.7-p5 Checking in the vendor/magento/module-theme/view/base/templates/root.phtml file there are no these two variables, so I think it is only for version of magento 2.4.8. Magento 2.4.8 https://github.com/magento/magento2/blob/2.4.8/app/code/Magento/Theme/view/base/templates/root.phtml Magento 2.4.7-p5 https://github.com/magento/magento2.../Magento/Theme/view/base/templates/root.phtml you can solve the problem with an if PHP: <?php if(isset($headCritical)): ?> <?= /* @noEscape */ $headCritical ?> <?php endif; ?> <?php if(isset($headAssets)): ?> <?= /* @noEscape */ $headAssets ?> <?php endif; ?>