jDownloads Support Forum

jDownloads for Joomla 4.x and 5.x => jDownloads 4.0 => Bugs! => Topic started by: wim49 on 21.08.2024 18:19:38

Title: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug - Fixed in 4.0.45]
Post by: wim49 on 21.08.2024 18:19:38
Since the update of Joomla from 5.1.2 to 5.1.3 I notice a change in jDownloads. I have so many items in some download categories on the site (e.g. more than 20) that pagination is needed in the frontend. In the jDownload options in the frontend tab the parameter Number of Downloads to show per page is set to 5. The first 5 are then displayed correctly, the next ones are not. I then suddenly see a number of main categories. I have simulated it on a test environment and indeed after the upgrade from Joomla 5.1.2 to 5.1.3 the problem occurred immediately.

jDownloads Version 4.0.42
PHP version 8.2
Title: Re: Problem caused bij Joomla 5.1.3
Post by: NJK on 21.08.2024 19:39:29
There are bugs relating to pagination in Joomla 5.1.3:

https://docs.joomla.org/Category:Version_5.1.3_FAQ
Title: Re:cron and special char
Post by: ColinM on 21.08.2024 22:08:34
Hi
Thanks forthe update,
Guess there will be a Joomla5.1.3 fix soon
Coin
Title: Re: Problem caused bij Joomla 5.1.3
Post by: patbe60 on 24.08.2024 16:05:21
After updating to Joomla 5.1.3 pagination works fine in all my components (jevents, phoca gallery) but not in jDownloads. I have also applied the proposed changes (https://github.com/joomla/joomla-cms/pull/43953/files) without succes.
In my opinion adjustments need to be made also in jDownloads.
Title: Problem caused bij Joomla 5.1.3
Post by: ColinM on 25.08.2024 10:23:50
hi
I have checked this out on two different test sites and all was OK.
Please advise which version of PHP you are using. I am using 8.2.22

Colin
Title: Re: Problem caused bij Joomla 5.1.3
Post by: patbe60 on 25.08.2024 11:47:13
PHP 8.3.10

I'm using jD also on an other website. Live I'm working with J 5.1.2 => no problems
On my local environment I' using J 5.1.3 and get the following error:

Warning: Undefined array key -1 in /Volumes/Dokumente/MAMP/panmusic5/components/com_jdownloads/src/Helper/LegacyRouter.php on line 481

It works, when I select "All Downloads" but I get the problem, when I select one single category.

In summary pagination works when browsing through categories or selecting "All Downloads". But when trying to browse in one single category through downloads the problems start like described in the first post.
Title: Re: Problem caused bij Joomla 5.1.3
Post by: ColinM on 25.08.2024 16:57:50
Hi
Just to ne clear is this when you use a menu item to show the downloads in a single category ?
When I set to PHp 8.3 then there were many problems so I reset to PHP 8.2 and all was well again.
So it may be PHP version problem.

Colin
Title: Re: Problem caused bij Joomla 5.1.3
Post by: patbe60 on 25.08.2024 23:21:28
Menu item is "List all cagetories". I have a lot of categories, showing 5 per page. Browsing works.
When I select one single cqtegorie, using the option "Display Category list box in Header" I see the downloads, also five per page. Here pagination is not working. When I click on a site number it leads always back to the category overview.
No problem when I select "All downloads".

The problem started with J 5.1.3.
That's why the Joomla developers made some security changes in Pagination.
A lot of component delevopers have already reacted to this change and adapted their components.

It happens with any php version, 8.1, 8.2, 8.3.

With Joomla 5.1.2 there were no problems with any of these php versions.

The problem can be seen in the URL: when you click the second page the URL is ../downloads?view=category&start=5 instead of

../downloads?view=category&catid=2&start=5

So the catid is missing. This needs to be fixed in jDownloads component.

Please check this :
https://docs.joomla.org/J5.x:Pagination_class_removes_query_parameters
Title: Re: Problem caused bij Joomla 5.1.3
Post by: ColinM on 26.08.2024 10:10:51
Hi
Thanks for the explanation.
Yes I have been able to reproduce.

After showing the first set of 5 the link to the next set is
https://jd-testing.com/index.php/list-all-jd-categs/category?start=5 which is clearly missing the catid as you have reported.
Will advise Arno.
Colin
Title: Re: Problem caused bij Joomla 5.1.3
Post by: Arno on 27.08.2024 09:59:02
Hi Guys,
thanks for the information. I will try to fix it very soon.  ::)  :-\
Title: Re: Problem caused bij Joomla 5.1.3
Post by: wim49 on 28.08.2024 09:36:52
I see in the announcement of Joomla 5.1.4 that the problem is apparently fixed there:
"Fixes the bug in pagination introduced by a security fix in 5.1. 3"

Maybe you don't need to do anything. :)
Title: Re:cron and special char
Post by: ColinM on 28.08.2024 10:08:39
Have just updated to 5.1.4 and it solves the pagination probem
Colinl
Title: Re: Problem caused bij Joomla 5.1.3
Post by: Arno on 29.08.2024 09:40:18
Nice. Thanks for the hint!  ;D
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: patbe60 on 29.08.2024 13:48:40
Quote from: ColinM on 28.08.2024 10:08:39Have just updated to 5.1.4 and it solves the pagination probem
Colinl
Sorry, no, the probem is not solved.

It only works when replacing the file libraries/src/Pagination/Pagination.php with this one from Joomla 5.1.2.

It's also not solved on Colin's testsite. Please check:

https://jd-testing.com/index.php/list-all-jd-categs/category/49-pdf-files

I think that is really necessary to set somewhere in your component the code

setAdditionalUrlParam

Please check this :
https://docs.joomla.org/J5.x:Pagination_class_removes_query_parameters

The fix in J 5.1.4 was for smart search. That's where the problem occurred.
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: wim49 on 29.08.2024 15:39:53
I can confirm what patbe60 says. In my case the problem is not solved too.
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: Arno on 30.08.2024 09:12:15
Okay. Thanks for the hint.
As a developer of a third-party component, you are happy when Joomla simply changes something in an update. After all, we have nothing else to do.  >:(  >:(
Title: pagination probem
Post by: ColinM on 30.08.2024 10:49:12
Hmm! That is very strange as it seemed OK when I first test on 5.1.4 but on retest I find problem is NOT resoved :(  :(

Colin
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: patbe60 on 30.08.2024 11:39:53
Quote from: Arno on 30.08.2024 09:12:15Okay. Thanks for the hint.
As a developer of a third-party component, you are happy when Joomla simply changes something in an update. After all, we have nothing else to do.  >:(  >:(

It's not necessary to replace the whole Pagination.php

You can just delete this code in libraries/src/Pagination/Pagination.php:

// Platform defaults
        $defaultUrlParams = [
            'format'        => 'CMD',
            'option'        => 'CMD',
            'controller'    => 'CMD',
            'view'          => 'CMD',
            'layout'        => 'STRING',
            'task'          => 'CMD',
            'template'      => 'CMD',
            'templateStyle' => 'INT',
            'tmpl'          => 'CMD',
            'tpl'           => 'CMD',
            'id'            => 'STRING',
            'Itemid'        => 'INT',
        ];
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: musicasampler on 02.09.2024 09:25:39
I did it, and I think it solved the problem. I'm going to test the site and in a few days I'll tell you if everything is ok, thanks.
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug] Solved
Post by: Arno on 03.09.2024 11:34:33
I have now published today a new version which fixed this issue.
jDownloads 4.0.45
.

Sorry for the long delay.  :-\  ::)
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug - Fixed in 4.0.45]
Post by: patbe60 on 03.09.2024 17:28:00
Thanks. Works perfectly now!
Title: Re: Problem caused bij Joomla 5.1.3 - [Joomla 5.1.3 Bug - Fixed in 4.0.45]
Post by: wim49 on 04.09.2024 09:31:53
Thanks Arno. Also here working perfect.
Title: Now Solved by jD
Post by: ColinM on 04.09.2024 11:00:42
This has been solved with jD4.0.45
Colin