false-negative "Invaild template file" #3802
Labels
Area: Frontend
bug report
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.1.x
The issue has been reproduced on latest 2.1 release
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
triage wanted
While using the
modman
I issued error which occurs when a module is placed somewhere outside the Magento 2 root directory. This is not themodman
-related things because it can be reproduced to any module which is placed outside the Magento 2 root.I found out the Magento2 fails where the template is validating against
isFile
(at\Magento\Framework\View\Element\Template\File\Validator::isValid
).I've also managed to fix that by changing the
\Magento\Framework\Filesystem\Directory\Read::isFile
method which is used to validate the template file. The problem is that method by default is joining the passed argument$path
with the Magento 2 root, while the template file symlink is a resolved path to the real file.You can preview my changes in the
diff
file.Preconditions
Steps to reproduce
Expected result
Actual result
system.log
message:main.CRITICAL: Invalid template file: '/home/tlaziuk/git/Example_Module/view/frontend/templates/example.phtml' in module: 'Polcode_GoogleTagManager' block's name: 'googletagmanager' [] []
The text was updated successfully, but these errors were encountered: