News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

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
  •