Closed (duplicate)
Project:
Project
Version:
5.x-1.x-dev
Component:
Usage statistics
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2007 at 19:22 UTC
Updated:
25 Feb 2009 at 12:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
nedjoThanks for taking this on, looks good, I haven't tested.
We could consider shortening the code a bit by avoiding some of the switch statements, e.g.,
For the 'pager' op, I'm thinking we should return
TRUEinstead ofFALSE, to avoid overly long lists.I imagine as soon as we apply this people are going to want combinations of sort methods, especially category + usage, but that would be for a different patch (and likely would require a fair bit of work, if it were even feasible within the present approach).
Comment #2
drewish commentedi got the category + usage browsing working. to get the API version specific usage i had to make some changes to the project_page_overview() so that it builds its query first and then merges in those returned by hook_project_sort_methods(). that way i could JOIN against the taxonomy term.
i'm not certain that it's sorting right when is selected as an API version. i suspect for that to work i'd need to be able to see the full query to see if a version had been selected... or, now that i think about it i guess i could just copy and paste the code that project_page_overview() uses:
and setup the query accordingly... though more looking makes it clear that my query is also dependent on
variable_get('project_release_browse_versions', 0)being true.marking this as needs work because of these unknowns but it really does need some reviews.
Comment #3
hunmonk commentedi'll ask the same question here that i asked over at http://drupal.org/node/171253 -- isn't this something that views could take care of as we move towards it?
project_page_overview() is a particularly complex and brittle function, and i'm pretty resistant to make changes to it now that might create more weird issues, when we've got a views overhaul on the near horizon.
Comment #4
dwwI haven't really thought about how views would interact with these browsing methods. I guess that instead of implementing hook_project_sort_methods(), any module that wants to add its own sorting method will just have to implement its own default view as a subtab. However, it's complicated by taxonomy, since the URL for the view will change depending on if a) taxonomy is enabled and b) the project taxonomy is being used. :( Therefore, again, this is at least weeks, if not a month or more, from being replaced with views.
However, in this case, I'm more inclined to lean towards hunmonk's position. This is absolutely true:
I'd *hate* to see a browse by usage patch introduce new bugs in this area of the code, and further delay the views conversion and D6 porting. I'm not sure we *need* browse by usage working urgently. Sure, it'd be nice, but so would a 6.0 core release. ;) I'd say http://drupal.org/node/165380 is more important than this in the short term. Just being able to see the statistics at all would be a good start. We can worry about sorting by most popular later.
Therefore, I'm marking this postponed, since I think it really *should* wait for the views-ification, and the complete refactoring (or removal) of this hook.
Comment #5
drewish commenteddid views support get committed yet? i haven't been following this queue very closely.
Comment #6
aclight commentedNope, not yet. See #76726: Refactor project module to use Views [meta issue].
Comment #7
dwwYes, this really is the same request as #66013: Create project sorting method using data from update.module.