No Code Attached Yet
avatar ceford
ceford
25 Sep 2021

Steps to reproduce the issue

I have two components with similar names, like this: com_thingy, com_thingy_plus

Expected result

All seems fine, except...

Actual result

If I select com_thingy_plus in the admin menu then both are highlighted. And if there are submenus both are open.

System information (as much as possible)

Additional comments

I have traced the problem to line 62 of media/mod_menu/js/admin-menu.js
if (!link.href.match(/index\.php$/) && currentUrl.indexOf(link.href) === 0 || link.href.match(/index\.php$/) && currentUrl.match(/index\.php$/)) {

I first noticed this with a custom media component named com_media_thingy - a bit of a nuisance to rename come_thingy_media!

avatar ceford ceford - open - 25 Sep 2021
avatar ceford ceford - change - 25 Sep 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 25 Sep 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Sep 2021
avatar PhilETaylor
PhilETaylor - comment - 25 Sep 2021

ffs here we go again. This would be so much easier to handle in PHP instead of JS.

avatar dgrammatiko
dgrammatiko - comment - 25 Sep 2021

This would be so much easier to handle in PHP instead of JS.

This would be so much easier if in the PHP we assigned an attribute like data-name=unique so JS doesn't have to do a lot of guessing (which no matter how good the regex is it will fail for some edge case that wasn't considered as valid cases).

avatar brianteeman
brianteeman - comment - 3 Oct 2021

duplicate of #34067

avatar ceford ceford - change - 4 Oct 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-10-04 08:36:26
Closed_By ceford
avatar ceford ceford - close - 4 Oct 2021
avatar ceford
ceford - comment - 4 Oct 2021

Searched before positing but clearly no well enough. Closing as #34067 has much better problem description.

Add a Comment

Login with GitHub to post a comment