[4.0] J4 Modules should require an element field#33182
Merged
chmst merged 3 commits intojoomla:4.0-devfrom Apr 23, 2021
Hidden character warning
The head ref may contain hidden characters: "\u2014fix-module-install\u20144.0-dev"
Merged
Conversation
Contributor
Author
|
BTW this should be a release blocker |
laoneo
approved these changes
Apr 19, 2021
This comment was marked as abuse.
This comment was marked as abuse.
Contributor
Author
|
Thanks @PhilETaylor code updated |
Member
|
I have tested this item ✅ successfully on fbe603a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33182. |
Contributor
|
I have tested this item ✅ successfully on fbe603a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33182. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33182. |
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
Since #32633 J4 (non legacy) Modules don't have a
module.phpfile in their root folderjoomla-cms/administrator/modules/mod_quickicon/mod_quickicon.xml
Line 14 in 2c30264
and thus it's impossible to install a module that uses namespace, check the existing code:
joomla-cms/libraries/src/Installer/Adapter/ModuleAdapter.php
Lines 337 to 356 in 2c30264
To mitigate this in the easiest possible way I propose to require (for the J4 native modules, not the legacy) one field in the XML: eg
<element>mod_wow</element>;Testing Instructions
You could test this in 2 different ways:
mod_quickiconadministrator/mopdules/mod_quickiconto a folder outside of the Joomla folderfile mod_quickicon.php doesn't exist)<filename module="mod_quickicon">mod_quickicon.php</filename>and adding after line 3<element>mod_quickicon</element>then zip the contents of the folder and try againAlternative you can download
https://jinvalidate.netlify.app/dist/j4/mod_invalidatecache_0.0.6.zipand observe that the module installs correctlyActual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required
@laoneo some feedback here?
@wilsonge ?