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

Error 404 since version 4.0.29 for single category

Started by gryff, 19.09.2023 10:14:53

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gryff

There are two Joomla sites with jDownloads installed. One is on pure Joomla, the other one uses Helium Gantry 5. On the first site no issues were found when upgrading jDownloads from 4.0.28 to 4.0.29 and 4.0.30.
However, the second site on Gantry 5 when upgrading from 4.0.28 to 4.0.29 gives a 404 error in menu items with a link to jDownloads. When logging into frontend as superuser all menu items are available, no errors.

jDownloads 4.0.30.
PHP Built On FreeBSD webs 13.2-RELEASE-p2 FreeBSD 13.2-RELEASE-p2 GENERIC i386
Database Type mysql
Database Version 10.11.5-MariaDB
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
Database Connection Encryption None
Database Server Supports Connection Encryption None
PHP Version 8.2.9
Web Server nginx/1.24.0
WebServer to PHP Interface fpm-fcgi
Joomla! Version Joomla! 4.3.4 Stable [ Bora ] 22-August-2023 16:00 GMT
User Agent Mozilla/5.0 (X11; FreeBSD amd64; rv:109.0) Gecko/20100101 Firefox/117.0
Framework: Gantry 5
Site Theme: Helium (v5.5.16 / g5_helium)

I found the problem with the /components/com_jdownloads/src/Helper/LegacyRouter.php file. It has been updated in version 4.0.29.

4.0.30
        // Check again, as we need a link to the download overview. A link from another component would be invalid.
        if ($menuItemGiven && isset($menuItem) && $menuItem->component != 'com_jdownloads'){
            // Invalid menu item
            $menuitems = $this->router->menu->getItems(array(), array());
            foreach ($menuitems as $menuitem){
                if ($menuitem->link == 'index.php?option=com_jdownloads&view=categories'){
                    $menuItem = $this->router->menu->getItem($menuitem->id);
                    $query['Itemid'] = $menuItem->id;
                    break;
                }
            }
           
4.0.28           
        // Check again
        if ($menuItemGiven && isset($menuItem) && $menuItem->component != 'com_jdownloads'){
            $menuItemGiven = false;
            unset($query['Itemid']);

The code "//Invalid menu item" was added. When I update to 4.0.30, I replace the LegacyRouter.php file with the 4.0.28 file and the error disappears. But I don't know the purpose of this code and so I'm not sure I won't have some side issues because of this.

Can I use this solution or is there an alternative?
  •  

gryff

There is the same problem with version 4.0.31. I need to copy back old LegacyRouter.php (4.0.28) to resolve the problem.
  •  

Arno

Okay, I will check this again in the next few days. Version 4.0.32 has fixed another bug.

Edit:
I have tested it on the jDownloads test website and could not see any problem:
https://jd40.jdownloads.org/single-download-category/category/18-video

So as you say, it seems only to be a problem together with Gantry 5 framework.  ::)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

gryff

Thank you Arno,

I would like to know the purpose of modifying LegacyRouter.php 4.0.28 so I can understand what my replacement with the old file could lead to when upgrading the jDownlods version.
  •