News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Itemid missing in MenuItem->link parameter

Started by Elfangor93, 16.08.2024 20:05:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Elfangor93

I added a menuitem of type "List all categories" in my main menu. After looking at the url in the menu I see that the Itemid is missing. Therefore Joomla opens the corresponding view without taking into account the menuitem parameters.

I confirmed with the Joomla-Core Maintainer who developed the modern router that the Itemid has to be added to the url by the component router. Seems like JDownlods is not doing that, so the Joomla\CMS\Menu\MenuItem->link parameter in the menuitem object is wrongly set. This leads to multiple misbehaviors.

System:
Joomla v5.1.0
PHP v8.1.2
  •  

Elfangor93

Additionally I get the following warnings ain the "List all categories" view pointing that there are some lines of code which are not properly evaluated.

Warning: Undefined array key 0 in \components\com_jdownloads\src\Helper\JDHelper.php on line 178

Warning: Attempt to read property "uploads_view_upload_icon" on null in \components\com_jdownloads\src\View\Category\HtmlView.php on line 109

Warning: Attempt to read property "uploads_view_upload_icon" on null in \components\com_jdownloads\tmpl\category\default.php on line 264

Warning: Attempt to read property "view_report_form" on null in \components\com_jdownloads\tmpl\category\default.php on line 1013
  •  

ColinM

Hi
At the present time jD does not support what are refered to as 'modern' links.
If you attempt to use them then it will go wrong as you have found.

If you look in jD Options - Frontend tab -URL Routing you will see it is disabled.

Colin
Colin M
  •  
    The following users thanked this post: Elfangor93

Elfangor93

Hi,
Thank you for the fast reply. As this missing Itemid does not have negative impacts when the menu is created using the Menu Module (mod_menu), I found a work around which is solving the problem. If the menulinks are generated in the template using the Joomla\Module\Menu\Site\Helper\MenuHelper::getList(), the missing Itemid is added manually and the negative impacts are gone.
Just for everyone else having this problem in the future...
Regrads
Manuel
  •