- Oct 18, 2020
- 116
- 565
- $186
I get this error when update new version 4.1.0
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
the new variables in the root.phtml file all give me the same error.Exception #0 (Exception): Warning: Undefined variable $headCritical in app/design/frontend/MageBig/martfury/layout01/Magento_Theme/templates/root.phtml on line 12
PHP:
[QUOTE]
<?= /* @noEscape */ $headCritical ?>
<?= /* @noEscape */ $headAssets ?>
[/QUOTE]
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: