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

Phoca Download - download manager
User avatar
madmetz
Phoca Member
Phoca Member
Posts: 34
Joined: 08 Apr 2019, 16:20

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

Hi, can you paste a screenshot of which view you exactly mean?
If you find Phoca extensions useful, please support the project
User avatar
madmetz
Phoca Member
Phoca Member
Posts: 34
Joined: 08 Apr 2019, 16:20

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

Hi, thank you very much, now I understand, I will take a look at it for the next version.

Thank you, Jan
If you find Phoca extensions useful, please support the project
User avatar
madmetz
Phoca Member
Phoca Member
Posts: 34
Joined: 08 Apr 2019, 16:20

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

Post by madmetz »

--- You're very welcome ---

Regards Mike
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post by Jan »

Hi,

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

Jan
If you find Phoca extensions useful, please support the project
User avatar
madmetz
Phoca Member
Phoca Member
Posts: 34
Joined: 08 Apr 2019, 16:20

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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
If you find Phoca extensions useful, please support the project
User avatar
madmetz
Phoca Member
Phoca Member
Posts: 34
Joined: 08 Apr 2019, 16:20

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

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47883
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

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

Post 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.

?
If you find Phoca extensions useful, please support the project
Post Reply