The auto_use ['views'] should be Disabled at a Global Level
I was experimenting with template replacement in Sellvana, and I think the current behavior w/r/t a global auto_use: [ views ]
should be changed.
If a user enables auto_use: [ views ]
at the global level, and uses it to replace a template in one area, the effects will spill over into all areas. While from a purely programatic point of view this is the "correct" behavior, based on experience with areas in Magento this seems likely to cause a lot of confusion (I was in the middle of reporting an "my admin is busted" bug until I realized what I'd done)
Given the potential for a frontend developer working on the frontend to potentially break a template required in the backend, and my not being able to think of reasons you'd want this functionality, using auto_use: [ views ]
at the global, not area specific level, should be disabled.
Reproduction Steps
-
Create a module with the manifest listed below (also, extension attached)
-
Notice the global level
auto_use
-
Enable your new module with a run level of
REQUIRED
-
Copy the
core/FCom/Frontend/Frontend/views/root.html.twig
template tocore/local/Pulsestorm/Helloworld/views/root.html.twig
-
Alter
core/local/Pulsestorm/Helloworld/views/root.html.twig
to include the text<h1>I am changing a frontend template</h1>
-
Browse to a frontend page, ensure your
<h1>I am changing a frontend template</h1>
text shows up -
Login to the admin
Expected Behavior: Backend displays are per normal
Actual Behavior: Backend page also displays the <h1>I am changing a frontend template</h1>
text
modules:
Pulsestorm_Helloworld:
version: 0.0.1
channel: beta
require: { module: { FCom_Frontend : 0.1.0 } }
description: "Module Description Here"
auto_use: [ views ]
Comments (3)
-
-
reporter Makes sense, and sounds like a reasonable solution. Thanks!
-
- changed status to resolved
- Log in to comment
The issue you're describing is not because of global
auto_use: [ views ]
configuration. Even if this configuration would be confined to areas only, it would still attempt to load the global moduleviews
folder. This was made for views that can be used in all areas, such as email templates. Also,FCom_Feedback
module uses the same template for both Admin and Frontend.I think it just should be reinforced in designer guide to use Frontend folder for all theme files.