Page 1 of 2

Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 18 Apr 2019, 12:39
by madmetz
Hello,

If a file does not exist anymore, when the counter is reset, the entry for this user still remains in the list.
Uploading multiple files that were deleted later results in a growing list of entries with the same username.

To reproduce this follow the steps below:
1. Upload a file (e.g. for userX)
2. Download this file (so the download counter for userX is incremented by 1)
3. Delete this file (because you probably don't want to keep it)
4. Go to control center -> downloads and select the entry 'userX'
5. Click 'Reset'

The result is as follows (after let's say 5 uploaded and then deleted files):
USER = userX, FILE = (), COUNT = 0
USER = userX, FILE = (), COUNT = 0
USER = userX, FILE = (), COUNT = 0
USER = userX, FILE = (), COUNT = 0
USER = userX, FILE = (), COUNT = 0

I would expect the entire entry / entries to be removed if an uploaded file no longer exists.

Regards Mike

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 18 Apr 2019, 14:17
by Jan
Hi, can you paste a screenshot of which view you exactly mean?

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 18 Apr 2019, 16:39
by madmetz
Hi Jan,

here is what you might want to see

I put together three screenshots in one so you can see step-by-step what happens.

Regards Mike

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 19 Apr 2019, 18:52
by Jan
Hi, thank you very much, now I understand, I will take a look at it for the next version.

Thank you, Jan

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 20 Apr 2019, 16:22
by madmetz
--- You're very welcome ---

Regards Mike

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 25 Apr 2019, 17:33
by Jan
Hi,

try to dwonload version 3.1.9. It should be OK there:
https://www.phoca.cz/download/category/ ... -component

Jan

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 29 Apr 2019, 19:30
by madmetz
Hi Jan,

thank you for your reply.
I have just installed v3.9.1 but I cannot see any difference - too bad !
There are still all the entries with the empty brackets ().

Regards Mike

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 30 Apr 2019, 14:51
by Jan
Hi, this could be old data in database. Does it happen to newly removed data (create a file, download a file, delete a file)?

Jan

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 30 Apr 2019, 21:02
by madmetz
Hi Jan,

Before my last try with v3.1.9, I cleaned the database manually by deleting the appropriate entries.
(There is no way to do this by phoca download instructions.)
But the effect remains the same as before.

Regards Mike

Re: Phoca Download - Faulty behavior of 'reset downloads' function in control center

Posted: 02 May 2019, 18:08
by Jan
Hmmm, testing now on different servers


Download statistics:
Image

After reseting the count of downloads:
Image

After deleting the test.zip file:
Image

After deleting both:
Image

Does your Phoca Download include the following code in file:

administrator/components/com_phocadownload/models/phocadownloadfile.php

https://github.com/PhocaCz/PhocaDownloa ... ca993c7ffb
(see the right side: below the comment //Delete files from statistics table)

This query just delete items in statistics table when the files are deleted.

?