Closed (won't fix)
Project:
Download Count
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2008 at 14:33 UTC
Updated:
10 Jul 2008 at 16:13 UTC
My site has a few attachments given the same name, but they're different files. The upload module looks after this very well, but this module freaks out with a count being incremented for any file with a matching name.
I've attached a patch that changes this module to store counts by the unique `fid` field from the uploads table.
It also shows the node title in the download counter page.
| Comment | File | Size | Author |
|---|---|---|---|
| download-count-by-fid.patch | 5.19 KB | mattconnolly |
Comments
Comment #1
Chill35 commentedCan you provide an update path for the table, ie: implement HOOK_update_1()?
Comment #2
Chill35 commentedActually this won't work for many people - including myself.
Often people want to update a file attachment, for example to correct something in it. The way to go about this is either to overwrite the existing file using FTP or remove the attachment -- effectively deleting the original file from the server - and then reattach the new file that has the same name. When updating a file like this, one may not want the counter to be reset to zero. If download_count is fid-based, rather than filename-based, any update/change to a file through the Drupal interface will cause the counter to be reset because a new fid will be generated for the file.