jDownloads Support Forum

jDownloads for Joomla 3.x => jDownloads 3.9 (Support ended) => Bugs => Topic started by: pippo8765 on 11.09.2020 12:58:51

Title: Multiple downloads creted after Batch [Solved]
Post by: pippo8765 on 11.09.2020 12:58:51
When I choose Batch for selected download (just one) and then Copy with assigned file, as result I get 2 copies in desired category.

This is a Browser problem
Title: Re: Multiple downloads creted after Batch
Post by: Arno on 11.09.2020 13:10:11
Hi pippo,
strange. I know that I had this a long time ago a few times. But I could never reproduce it.
I think I need more information to find the reason.

Are you sure that this happen every times? Also with categories?
Are the Downloads from subcategories?  ::)
Title: Re: Multiple downloads creted after Batch
Post by: pippo8765 on 11.09.2020 13:20:54
Hi Arno,
yes, it happens no matter where the source is. From subcategory to category, from cat to cat, no matter. Creates duplicates. Latest Joomla, just installed, latest JDownloads, updated from 3.9.4 to 3.9.5, testing grounds...
php 7.3.21. Nothing heavy in Joomla, all fresh, as said - just installed with some of my default stuff, JD being one of them.
Title: Re: Multiple downloads creted after Batch
Post by: pippo8765 on 11.09.2020 13:29:46
Also,
file is not copied when I select "Copy with assigned file". Only one instance of a file remains in original folder.
As for Move - same thing. Only one file stays in it's original folder.
I'll also try to see if it's somethinng on my side.
If someone else is experiencing, please say so. Thanks Arno.
Title: Re: Multiple downloads creted after Batch
Post by: Arno on 11.09.2020 13:44:00
Thanks pippo. We will check this part again intensively.
Title: Re: Multiple downloads creted after Batch
Post by: pippo8765 on 11.09.2020 14:33:22
Thank you very much. I am also trying to conclude when this actually happens, since after so many clicks I got here and there that it copies only once sometimes, but have no idea why for now. Most of times it creates 2 copies. What I am sure of is that it does not copy file to new category folder. It never happens. I am on Windows, all permissions for that ok, local machine, WAMP server blahblah... So pretty much should do the work.
I am also staring at batch and batchCopy functions in model, so if something comes to my mind I'll write.
Title: Re: Multiple downloads creted after Batch
Post by: Arno on 12.09.2020 20:41:37
Hi pippo,
thanks a lot for your help and the information about your test environment.  :)
I hope I have tomorrow the time for it.
Title: Re: Multiple downloads creted after Batch
Post by: Arno on 13.09.2020 23:22:37
Hi pippo,
when you want you could test the fixed file below.
Please copy the unzipped file to: /administrator/components/com_jdownloads/models/
and overwrite the original file.

Files should now be copied correctly when selected.
Please post here your results.

By the way, I could not reproduce the 'double' items at the moment.
Title: Re: Multiple downloads creted after Batch
Post by: pippo8765 on 14.09.2020 13:24:12
Hi Arno,
yes, files are being copied now. Multiple downloads remains. I am still trying to figure out why that happens. Strange you can not replicate it. Also, for now I have no conclusion WHEN it happens. For me it does not happen, then I repeat same procedure - it duplicates. No matter cat to cat or cat to subcat or vice versa. Drives me crazy hahahaha!
Thank you for quick files fix, saw what you did.
Title: Re: Multiple downloads creted after Batch
Post by: Arno on 14.09.2020 16:10:55
Hi pippo,
thanks for the result.
Yes the double Downloads creation is a mysterious thing.  ::)
Title: Re: Multiple downloads creted after Batch
Post by: pippo8765 on 15.09.2020 10:47:46
Hi Arno, I have both good and bad news. Bad news mostly for me, good for most people, but I think it should be here, so maybe it's more common thing, so latest update on this:

on my local dev machine I run Windows and have WAMP installed. Pretty default config for server, nothing special. I tested 3 different versions of php (7.0.x, 7.2.x and 7.3.x) all give me same result: doubling batch requests (no matter which options I choose). Here and there it happens that it doensn't, but 99% it makes 2 instances. What I tested more is that it does the SAME THING WITH CATEGORIES! So - batch process category -> makes 2 categories. Also, I tested 3.2.69 version - SAME THING HAPPENS.

Good news is that I tested it on our production server here, Linux blahblah,  more serious - ALL WORKS FINE! My guess is that most people are not using WAMP or integrated solutions except for developing purposes, so it won't be so common. Question still remains - why it happens. I'll try to figure it out somehow...
Cheers, thank you for your excellent work.

Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: Arno on 15.09.2020 11:00:02
Hi pippo,
thanks a lot for your lot of tests. So I will not more time spend at this. Good message.

By the way, have you the same result when you use the batch for articles?
Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: pippo8765 on 15.09.2020 11:05:14
Just came here to write you that hahaha!
No, articles work fine, just tested. Categories also, Joomla categories.
Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: Arno on 15.09.2020 12:33:24
Okay. Thanks for this hint. So it could also be really a jD problem. 
We will see...
Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: pippo8765 on 15.09.2020 13:32:54
Hi again,
just to let you know that your extension is not the only one with this anomaly. I also tested K2 now - same thing!
Seems like only thing that is acting normal is Joomla core stuff: articles and categories. I also used another Windows server and it acts like my dev server. Maybe it's Windows? Is there anyone else who can do tests like this? Thanks.

It won't be a problem if you keep an eye on it, but it's not supposed to work that way :)))

I hope we narrow the problem even more. I might try with earlier Joomla versions now.
Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: pippo8765 on 15.09.2020 14:16:52
I think I found it: combination of server and browser!
I am using Firefox, latest, 80... something. Always updated.
So, all in all: server on windows + Firefox browser -> for some reason seems like form is cached, cache not cleaned and form resubmitted in Batch process.

I disabled and unistalled all addons, just to be sure, though I am using only 3-4 standard, add blocker blahblah. It's not up to them! Firefox is preventing cache clean in combination with Windows version of server (php + Apache).

If you know how to deal with this - great. So it might happen. It's not up to your code, I don't know how to prevent this. I don't know how Joomla core stuff works and the rest is not...

Chrome works like a charm, of course.
Title: Re: Multiple downloads creted after Batch - [Not reproducable on server]
Post by: ColinM on 15.09.2020 15:29:52
Hi
Thanks for the updateThat accounts for it happening on my XAMPP web sites but not o when using Firefox testing where I have the Empty Cache Button extsion installed.  Always using it when testing to ensure a clean site!!!

Have you reported this to Firefox?
Colin
Title: Re: Multiple downloads creted after Batch [Solved]
Post by: pippo8765 on 16.09.2020 09:56:35
It's totally crazy. Now in 10 successive copies I made, 4 of them were doubled, 6 were regular.
I don't know what to write to Mozilla, I would! I am trying to see what might be  wrong with my server settings, always doubting myself first. But it works with Chrome, Edge and even Mozilla Developer Edition 100% correct.
I uninstalled all add-ons, so plain Firefox is also causing this error. I am trying to see if request is sent more than once or it's some cache left behind. I just installed that addon for cleaning cache, though I am always doing it manually because of developers actions.


[16/Sep/2020:09:48:09 +0200] "POST /joom3/administrator/index.php?option=com_jdownloads&view=downloads HTTP/1.1" 303 4
[16/Sep/2020:09:48:09 +0200] "GET /joom3/administrator/index.php?option=com_jdownloads&view=downloads HTTP/1.1" 200 70877

[16/Sep/2020:09:48:39 +0200] "POST /joom3/administrator/index.php?option=com_jdownloads&view=downloads HTTP/1.1" 303 4
[16/Sep/2020:09:48:39 +0200] "POST /joom3/administrator/index.php?option=com_jdownloads&view=downloads HTTP/1.1" 303 4
[16/Sep/2020:09:48:40 +0200] "GET /joom3/administrator/index.php?option=com_jdownloads&view=downloads HTTP/1.1" 200 81621

That first part of login is when it happened correct. Immediately after that I copied another one and it created 2 consecutive POST requests, making of course 2 copies. It's like I clicked twice. Also, timestamp is exactly the same.
I know this goes beyond JDownloads now, thank you for your time.
Title: Re: Multiple downloads creted after Batch [Solved]
Post by: ColinM on 16.09.2020 10:06:39
Hi
With my testing the problem only seems to happen on the XAMPP sites with Firefox.On a web based site I have not had it happen!!
Most strange. :(
The XAMPP I am using has PHP 7.2
Think you are using WAMP.  Is that correct?
Colin
Title: Re: Multiple downloads creted after Batch [Solved]
Post by: pippo8765 on 16.09.2020 10:11:39
Yes. For me WAMP + Firefox = problem. All other combinations not.
Is your XAMPP on Linux or Windows?
Title: Re: Multiple downloads creted after Batch [Solved - No Bug]
Post by: Arno on 16.09.2020 11:48:20
Okay. I use xampp only with Chrome or Brave. And have no problems with this.  ;)

Thank you pippo for so desperately wanting to find the reason! Good Job!
Title: Re: Multiple downloads creted after Batch [Solved]
Post by: ColinM on 17.09.2020 10:15:06
Pippo
Xammp on Windows
Colin