Active
Project:
Privatemsg Views
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2010 at 13:11 UTC
Updated:
20 Oct 2010 at 19:42 UTC
Jump to comment: Most recent file
Pager doesnt work.
This code do for your default views
function mymodule_views_pre_execute(&$view) {
if ( $view->name == 'privatemsg_mailbox' ) {
$view->build_info['count_query'] = 'SELECT (pm_message.mid) FROM {pm_message} pm_message INNER JOIN {pm_index} pm_index ON pm_message.mid = pm_index.mid WHERE (pm_index.deleted = 0) AND (pm_index.uid = %d)';
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | privatemsg_views_861560.patch | 1.04 KB | crea |
| #4 | privatemsg_views_861560.patch | 989 bytes | crea |
Comments
Comment #1
crea commentedThanks for the tip, but the query you're suggesting is wrong. There's no GROUP BY or DISTINCT in it thus it doesn't represent base query. You are simply counting messages, we OTOH need to count threads.
But I would like to avoid the approach, cause it works in a limited way and is closely tied to the supplied view. Would be best to work out a solution that worked for all views.
Comment #2
crea commentedComment #3
crea commentedFor anyone interested, I described the problem in the Views queue: #904284: Count query optimization code only checks $this->groupby and not presence of "aggregate" fields.
Comment #4
crea commentedAttaching temporary fix until the aforementioned request is answered
Comment #5
crea commentedBetter patch from the root of the module.
Comment #6
crea commentedI've committed the patch above to the dev branch. Not closing this issue to wait for proper solution.
Comment #7
crea commentedOk, since this is fixed in dev, changing to a task.
Comment #8
crea commented