J3 Issue ? ?
avatar uglyeoin
uglyeoin
14 Jan 2019

Steps to reproduce the issue

Create two login modules on a page such as here: http://kgbfacilityservices.co.uk
I know they do the same thing but this is what the client wanted.

Expected result

ID should only be used once in a page

Actual result

ID is used as many times as the module is used.

System information (as much as possible)

n/a

Additional comments

I know this is an unusual use of the login module, but it is still a module and thus it could be used multiple times on any page. Potentially in the footer and a sidebar. Or in a popup or menu item as well as visible lower down the page. On the whole I do not think modules should contain an ID as they are meant to be repeatable. A class is probably sufficient for styling purposes.

Open to input from other people as there may be a counter argument.

This would have to be a J4 change to avoid b/c breaks.

avatar uglyeoin uglyeoin - open - 14 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Jan 2019
avatar brianteeman
brianteeman - comment - 14 Jan 2019

Personally I would just create two different layouts and put unique ids in the layouts

avatar chmst
chmst - comment - 14 Jan 2019

Same problem here: in 3.x as well as in 4.0. https://issues.joomla.org/tracker/joomla-cms/23070


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23538.

avatar uglyeoin
uglyeoin - comment - 14 Jan 2019

@brianteeman that is a good solution that would work. The website has been live for years and it causes me no issues. But a good suggestion, thank you.

It does not detract from the overall premise that modules are designed to be repeatable, and should therefore not contain an ID. I would think it should be a rule that this is not permissible in a module. There's an ID in the search module too.

avatar uglyeoin
uglyeoin - comment - 14 Jan 2019

For clarity @chmst is talking about #23397 (comment)

avatar uglyeoin uglyeoin - change - 14 Jan 2019
Title
RFC: Login module has an ID
RFC: Login & Search module contain an ID but should not as they are repeatable
avatar uglyeoin uglyeoin - edited - 14 Jan 2019
avatar mbabker
mbabker - comment - 14 Jan 2019

It does not detract from the overall premise that modules are designed to be repeatable, and should therefore not contain an ID. I would think it should be a rule that this is not permissible in a module. There's an ID in the search module too.

Actually, the Smart Search module is an OK example of cases where IDs can be used (even if it were using classes, with the JavaScript interactions you'd still need it to explicitly target the single module's markup and not every instance on the page). The problem is having unique identifiers and not duplicating them (which isn't that hard to pull off thanks to scope leakage, the $module object is available in layouts and you've generally already got a unique identifier in the id property). So it's not inherently "ID is bad", it is "non-unique ID is bad" and THAT is the issue to be addressed.

avatar uglyeoin
uglyeoin - comment - 14 Jan 2019

Good point, modules already have a unqiue ID, so it would simply be a pull request to add that to the existing ID and then update the JS to understand that right?

avatar brianteeman
brianteeman - comment - 14 Jan 2019

@uglyeoin as you wont see this as a new feature until 2020 I was offering you a solution for today.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 28 Mar 2019

@uglyeoin do i understand correct you will create a Pull Request against J4?

avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Status Discussion Information Required
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_modules
avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Apr 2019
Title
RFC: Login & Search module contain an ID but should not as they are repeatable
[RFC] Login & Search module contain an ID but should not as they are repeatable
avatar joomla-cms-bot joomla-cms-bot - edited - 1 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar uglyeoin
uglyeoin - comment - 13 Apr 2019

@franz-wohlkoenig my apologies I've been away. Sure I'll do a pull request against J4.

avatar uglyeoin uglyeoin - change - 26 Apr 2019
Title
[RFC] Login & Search module contain an ID but should not as they are repeatable
[4.0] Login & Search module contain an ID but should not as they are repeatable
avatar uglyeoin uglyeoin - edited - 26 Apr 2019
avatar SharkyKZ
SharkyKZ - comment - 17 May 2019

Test PR #24933 please.

avatar franz-wohlkoenig franz-wohlkoenig - close - 17 May 2019
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 May 2019

Closed as having Pull Request #24933

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 May 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-05-17 08:19:21
Closed_By franz-wohlkoenig
Labels Added: ?
Removed: ?

Add a Comment

Login with GitHub to post a comment