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)';
	}
}

Comments

crea’s picture

Priority: Normal » Major

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

crea’s picture

Title: Pager do not work » Mailbox pager does not work
crea’s picture

crea’s picture

Status: Active » Needs review
StatusFileSize
new989 bytes

Attaching temporary fix until the aforementioned request is answered

crea’s picture

StatusFileSize
new1.04 KB
new1.04 KB

Better patch from the root of the module.

crea’s picture

I've committed the patch above to the dev branch. Not closing this issue to wait for proper solution.

crea’s picture

Title: Mailbox pager does not work » Mailbox pager count query optimization fails
Category: bug » task
Status: Needs review » Active

Ok, since this is fixed in dev, changing to a task.

crea’s picture

Priority: Major » Normal