Closed (fixed)
Project:
Audio
Version:
5.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 May 2007 at 03:20 UTC
Updated:
28 May 2008 at 04:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickNow using brand-spankin' new 5.x-2.x-dev, problem still persists.
The problem is actually tied to the use of revisions. When I check the audio table, all the counts are there, they're just associated with only the particular vid.
Possible solutions:
1) Don't version these fields. Have them always take the total.
2) Have the play/download counts display a the sum of all download/play counts for that nid.
Comment #2
mfbMy suggestion would be a separate table for the counts, with nid as the key.
This could also improve db performance on very busy sites, since the frequent writes would only be happening to the audio_count table.
Comment #3
webchickGood idea! Here's a patch. Because it drops the play/download count columns from audio, it is destructive and should be thoroughly tested on a test database ;)
Thanks very much for luke-jr in #mysql on irc.freenode.net for help on the tricky query to update the play/download counts. You rule! :D
Comment #4
webchickOops. Forgot about the insert case.
Comment #5
webchickFixing title.
Comment #6
mfbI think views_audio.inc will also need to be updated to reflect the schema change.
also i think everything could be $ret[] = update_sql, including inserts and create tables?
Comment #7
webchickHere's a patch which seems like it should work but really doesn't. ;)
a) the drop columns are failing... no idea why, since I didn't change them since the previous patch where they were working.
b) Views doesn't "get" the schema change, even after I cleared the cache. :(
Help? :(
Comment #8
webchickCool, this gets rid of the update errors (duh!). Views is still a problem.
Comment #9
webchickTo reproduce, click "Add" next to the audio view. Make it a table view, and add the "play count" and "download count" fields. Navigate to ?q=audio and see:
Comment #10
mfbI actually don't have any database errors.. perhaps it was cached from before you applied the patch?
Comment #11
mfbI'm not sure what's "normally" done in these cases, but it might also be a good idea for this patch to update the tablename in in the view_tablefield table, and clear out all the views caches.
Comment #12
rjleigh commentedI found this bug too - is there a reason why this patch (or another fix) never got into the codebase?
There doesn't seem to be audio revision support in general - there's no tab added to the node when revisions are available.
Comment #13
mfbthe one question I had about this patch was, would the update script also need to update the tablename columns in the view_* tables? I'd assume so... (I wonder if there's been another similar case of new data structure for a contrib module, with views already having been defined using the old structure)
Comment #14
mfbHere's a lighter-weight patch that simply resolves the issue without changing table structure.
Comment #15
drewish commentedthanks, committed to HEAD.
Comment #16
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.