No Code Attached Yet bug
avatar brianteeman
brianteeman
9 Mar 2026

What happened?

This has been reported a few times since the release of j4 and I think I have finally got to the bottom of it. Sadly I dont have the fix but I hope there is enough information here for someone to be able to fix the missing piece

To see the problem in action (any version of Joomla) go to the content categories menu and click on one of the counters to open a filtered view of the articles.

Image

This will correctly open the article view with the selected filter

Image

The problem however is that we have now lost the active menu item in the menu sidebar

Image

It should be displayed like this

Image

The reason for this is that the url generated in the category view is structured

administrator/index.php?option=com_content&filter[category_id]=2&filter[published]=1&filter[level]=1

Note that there is no view=articles

The link worked because articles is the default view for com_content but the active menu is not set because that relies on the view

You can verify that the acticve menu is correctly selected if you manually set the url to be

administrator/index.php?option=com_content&view=articles&filter[category_id]=2&filter[published]=1&filter[level]=1

If we look at the code in com_categories for generating the link

<a class="btn <?php echo ($item->count_published > 0) ? 'btn-success' : 'btn-secondary'; ?>" href="<?php echo Route::_('index.php?option=' . $component . ($section ? '&view=' . $section : '') . '&filter[category_id]=' . (int) $item->id . '&filter[published]=1&filter[level]=1'); ?>" aria-describedby="tip-publish<?php echo $i; ?>">

there is code for adding the view but $section is always empty

$extension = $this->escape($this->state->get('filter.extension'));
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = ($listOrder == 'a.lft' && strtolower($listDirn) == 'asc');
$parts = explode('.', $extension, 2);
$component = $parts[0];
$section = null;
if (count($parts) > 1) {
$section = $parts[1];
$inflector = Inflector::getInstance();
if (!$inflector->isPlural($section)) {
$section = $inflector->toPlural($section);
}
}

This block of code was added by @bembelimen way back in 3.5.1#9580

I think that was for something else whcih we see with fields where the urls has content=com_content.article but the important thing is that this bug is fixed by adding the correct view to the url

The important thing is that this is not something that can be fixed in the menu or the js as the problem is the missing view in the url from the category component

Version

5.4

Expected result

No response

Actual result

No response

System Information

No response

Additional Comments

also see #34067

avatar brianteeman brianteeman - open - 9 Mar 2026
avatar joomla-cms-bot joomla-cms-bot - change - 9 Mar 2026
Labels Added: No Code Attached Yet bug
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Mar 2026
avatar brianteeman brianteeman - change - 9 Mar 2026
The description was changed
avatar brianteeman brianteeman - edited - 9 Mar 2026
avatar brianteeman
brianteeman - comment - 9 Mar 2026

@LadySolveig i hope this information helps

avatar brianteeman brianteeman - change - 9 Mar 2026
The description was changed
avatar brianteeman brianteeman - edited - 9 Mar 2026
avatar brianteeman brianteeman - change - 9 Mar 2026
The description was changed
avatar brianteeman brianteeman - edited - 9 Mar 2026
avatar bembelimen
bembelimen - comment - 9 Mar 2026

Not sure if I understood it correctly, but missing hidden menus has a very easy reason: https://github.com/joomla/joomla-cms/blob/5.4-dev/build/media_source/mod_menu/js/admin-menu.es6.js#L98

The menus are wrongly compared. Correctly they should be compared parameter-wise, so if option, view and layout (not sure about that) are the same. Currently the menu are compared just by string. So changing the order of a menu or adding any extra parameter makes the element not active any more. Additionally if menu and link has same view prefix, they get highlighted as active.

index.php?option=com_example&view=foo is same as index.php?option=com_example&view=foobar because one is the "prefix" of the other.

Solution: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get + correct compare.

avatar brianteeman
brianteeman - comment - 9 Mar 2026

@bembelimen the problem is that in this case there is no view in the url

avatar bembelimen
bembelimen - comment - 9 Mar 2026

Correct extension would be com_content.article I guess. There is no real fix, only a band aid fix by changing the lines you marked. Better would be to have always a section. Still the whole menu active thing is broken in some way.

avatar brianteeman
brianteeman - comment - 9 Mar 2026

@LadySolveig has fixed most of the menu active stuff but this is a different beast

avatar Reda-Muhamed
Reda-Muhamed - comment - 10 Mar 2026

This issue in com_categories and I found why it happens.

When the extension is just com_content (without a dot), the code in default.php doesn't find the section, so it returns a null view. This is exactly what Brian mentioned and I added a fallback to deduce the section from the component name (with a special check for com_content to use articles

avatar LadySolveig
LadySolveig - comment - 10 Mar 2026

I prepared something that works similar to the frontend. I think that could happen in 7 at the earliest, if at all. Since it includes B/C breaks.

avatar brianteeman
brianteeman - comment - 10 Mar 2026

@LadySolveig interesting but this PR from @Reda-Muhamed is fully b/c as far as i can see

avatar Reda-Muhamed
Reda-Muhamed - comment - 10 Mar 2026

I want to clarify that I used the AI only to write the PR description and format my text, did not use AI to write the code. I read the issue, understood the problem, wrote the code myself, and tested it on my local computer

Add a Comment

Login with GitHub to post a comment