User tests: Successful: Unsuccessful:
It redo of #32980, but without use of ID attribute
Select background Image for mod_custom,
And check module on the site, also the module HTML markup
Background visible, module have an ID attribute
Background visible, module do not have an ID attribute
none
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Front End Templates (site) |
Title |
|
Category | Modules Front End Templates (site) | ⇒ | Administration com_installer Modules Front End Templates (site) |
Labels |
Added:
?
|
Category | Modules Front End Templates (site) Administration com_installer | ⇒ | Modules Front End Templates (site) |
That because it was for 4.1 first.
Should be good now.
Why the ID needs to be removed?
This pull requests has been automatically converted to the PSR-12 coding standard.
Labels |
Added:
?
|
@simbus82 This is why: #37873 (comment) - multiple IDs are possible.
@Fedik
Do we need an extra classname? Other modules don't.
The variablename $modid sounds like and ID but makes a classname.
Do we need an extra classname? Other modules don't.
The code changes use of ID to class-[id]
@simbus82 This is why: #37873 (comment) - multiple IDs are possible.
Ok, it's clear that we can't have multiple ID in a single DOM (but only for validation): in 2022 is only a problem if we try to pointing them wrongly with CSS and JS.
Removing an ID (in the core since one year) can break lot's of templates that rely on this method to apply some css styles.
I hope users will be informed about this B/C.
As pointed out before by others removing the id will be an isssue for any site that is using the id for css and/or js (I am) and while it can be argued that this is not covered by the b/c promise is it really necessary?
The only way that you can have one module (with the same id) published more than once is to additionally load the module in some content with the loadmodule plugin. As that is a deliberate action by the web developer to publish the module twice on the same page when it makes no sense to do so I would expect the occurance of this to be infinitely less than the use of the id or js/css
I just sugested a solution to avoid duplicated ids (even if it rare possible) :)
It can be accepted or closed, I am fine with both.
Mod_custom is the module used as reference for new module that should not suggest to use wrong syntax.
For keep b/c I can revert ID (for people who use js), but the styling (background image) will be done with class. And will remove ID in j5 (if no one forget).
Deal? :)
Hey everyone, I am new here. Please tell me how to start here and what are the skills required to contribute here.
@Mrsuperstar304 thank you for your interest in contributing to Joomla. Maybe you start with this video https://www.youtube.com/watch?v=30JYBOeNVTA. Or search for "how to contribute " in joomla documentation.
Mod_custom is the module used as reference for new module that should not suggest to use wrong syntax.
And it's a wrong syntax to not have an unique ID for every instance of rendered mod_custom in the DOM
I have restored ID, and added a comment that it should be removed in next Major version
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-03-22 10:46:20 |
Closed_By | ⇒ | Fedik | |
Labels |
Added:
?
Removed: ? |
The changes to administrator/components/com_installer/src/Controller/InstallController.php look unrelated to me