[4.0] Deleting duplicate module parameters#23553
[4.0] Deleting duplicate module parameters#23553Hackwar wants to merge 10 commits intojoomla:4.0-devfrom
Conversation
|
Personally, I wouldn't move the layout parameter as there may well be 3rd party modules that don't support layouts. And I don't like parameters that don't work. The module class makes sense to me, since we move the module class out of the module to be only in the chrome. Which means it's supported as long as the template (and not the module) supports it. The cache makes sense if it works even if the modules don't have any code for it. I honestly don't know if the modulehelper has some default behavior to use static caching if the module doesn't ask for something else. |
|
So half the core modules have the parameter named 'cache', the other half has it named 'owncache'. I'm not messing around with that here, please someone decide which name to use. |
|
I've rearranged the parameters a bit by having the identical parameters in a |
| <field | ||
| name="language" | ||
| type="contentlanguage" | ||
| type="language" |
There was a problem hiding this comment.
Wrong! It is OK for admin modules but NOT for site modules where the choice depends on existing Content Languages and not Installed languages.
Note: We also have to improve this for admin modules indeed as the language field is only displayed in function of the language filter enabled.
Admin modules filtering by language should be implemented independently of the Content Languages and depending on the availability of admin languages.
EDIT: I remarked you have set 'contentlanguage' as type for site.xml. But the issue is that it does not work here.
There was a problem hiding this comment.
Looks like the error is in
joomla-cms/administrator/components/com_modules/Model/ModuleModel.php
Lines 555 to 568 in 6e90789
There was a problem hiding this comment.
I have no idea what your issue is. It displays the language with the content languages for frontend modules when enabling multilang support and otherwise hides it.
|
I have tested this item 🔴 unsuccessfully on 6e90789 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23553. |
|
Fixed it |
|
Ok, so since the parameters are already identical for backend and frontend, I've changed this around a bit to make this clearer. To repeat: Right now (without this PR) we already have the same parameters in the frontend and backend. This PR cleans up the code a bit and moves the parameters that are identical across all modules into the common parameters file for all modules. |
|
Did not test all aspects, but my main remarks above are now solved. :) |
|
Could you then change your test result? |
|
Closing as it does not take into account modules not using cache. |

In Joomla 1.5, these parameters were in the default XML that com_modules loads. Then someone decided in 1.6 that it would be better to remove them from the default XML and instead copy all of them into each and every modules own XML file. Then in 3.0 we again added such parameters to the default XML. Sounds totally logical to me...
Anyway, this removes all that duplicate code and moves these duplicate parameters back into the advanced.xml. We should consider moving the content from advanced.xml into module.xml and moduleadmin.xml, where the caching would be dropped for the admin modules. (Caching is always disabled for logged in users anyway...) But that is something for another PR.
This has a downside, that some parameters might not be supported by the module and thus not work. Since the caching is done in the ModuleHelper class and the moduleclass suffix is now done in the chrome, that leaves the layout. I would say that that is acceptable and would push third party devs to better adapt the Joomla style of writing modules to support this parameter.
Going through all of this also showed that a bunch of modules had wrong paramters for caching. This should fix that one, too.
How to test?
Edit a module, see the parameters under advanced. Apply the patch, check the parameters again and see that they are all present and accounted for.