Conversation
Co-Authored-By: Brian Teeman <brian@teeman.net>
| $wa = $app->getDocument()->getWebAssetManager(); | ||
|
|
||
| // Allow template to provide its own asset for the module | ||
| if (!$wa->assetExists('script', 'mod_login.admin')) |
There was a problem hiding this comment.
What's the advantage of this vs a regular template override?
There was a problem hiding this comment.
Regular template override will override by path, but cannot overide asset by name for modules, because the module will be rendered after index.php of template (I mean template assets loaded before any module).
And example in current case mod_login will replace 'mod_login.admin' to its own (even if the template provide it also).
With suggested changes if template provide 'mod_login.admin' then it will be used instead of one provided by "module"
I found this issue while doing changes for a modules.
I also thinking about something like registerIfNotExists() but not sure currently. For now made extra if() check in modules.
There was a problem hiding this comment.
But surely that's only useful for presets rather than singular assets like this where we have a single resource? I don't see the benefit here
There was a problem hiding this comment.
I want allow to template to override asset by "asset name".
To be consistent. Because it possible for components, and not really for modules, because they "goes after" template.
But I can revert such part, not much critical issue.
There was a problem hiding this comment.
I think let's revert for now please
|
Thanks! |
|
now left layouts (#28431) and hardest part: components 😃 |
Summary of Changes
This replaces htmlhelper to webaset for modules
Updated modules:
Components:
Testing Instructions
Apply patch, run
npm installReview all updated modules
Expected result
All work
Actual result
All work
Documentation Changes Required
none
ref #22435