Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false-negative "Invaild template file" #3802

Closed
tlaziuk opened this issue Mar 16, 2016 · 3 comments
Closed

false-negative "Invaild template file" #3802

tlaziuk opened this issue Mar 16, 2016 · 3 comments
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

Comments

@tlaziuk
Copy link

tlaziuk commented Mar 16, 2016

While using the modman I issued error which occurs when a module is placed somewhere outside the Magento 2 root directory. This is not the modman-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

  1. Magento 2.

Steps to reproduce

  1. Create module which is using frontend templates and place the code somewhere outside the Magento 2 root directory, but symlink the code to the place under Magento 2 project where it should be.
  2. Setup your new module.

Expected result

  1. If the template file is valid, everything should be working

Actual result

  1. 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' [] []
@mazhalai
Copy link
Contributor

@tlaziuk Thank you for reporting, we have created MAGETWO-50851 to investigate and fix.

@mazhalai mazhalai self-assigned this Mar 23, 2016
@mazhalai mazhalai added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Mar 23, 2016
@vkorotun vkorotun removed the PS label Aug 4, 2016
@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Area: Frontend Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Nov 27, 2017
@magento-engcom-team
Copy link
Contributor

@tlaziuk, thank you for your report.
We've created internal ticket(s) MAGETWO-84536 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 labels Nov 27, 2017
@magento-engcom-team
Copy link
Contributor

@tlaziuk, thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

You may learn more about this initiative following this link.

Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.

pdohogne-magento pushed a commit that referenced this issue Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

6 participants