Is there any incompatibility between Custom pagers and Views 3?

I can't see the navigation links using Views 3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michael.k’s picture

Title: View3 compatibility » Views 3 compatibility

I am also seeing some problems with Views 3 (6.x-3.x-dev, 2010-Sep-14).

The Custom Pagers are completely gone from both the node and block, and I get this error:

warning: Invalid argument supplied for foreach() in /var/www/vhosts/project/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 904.
warning: Invalid argument supplied for foreach() in /var/www/vhosts/project/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 980.
warning: Invalid argument supplied for foreach() in /var/www/vhosts/project/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 904.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM node node WHERE (node.type in ('pictures')) AND (node.status <> 0)' at line 2 query: SELECT FROM node node WHERE (node.type in ('pictures')) AND (node.status <> 0) in /var/www/vhosts/project/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1122.

Some context: With Views 2 I was able to get Custom Pagers to cycle through whatever collection of picture nodes that passed through the filter (ie, pictures for everybody). This worked okay as long as the list was small and relevant, but it was not how I intended it. My goal was to limit the paging to the relevant nodes associated to a taxonomy term by passing an argument for a term ID (ie, pictures for a specific person). This didn't work for me, even though I was able to make it work in the Views 2 interface. So maybe I wasn't properly configuring my taxonomy terms to work with Custom Pagers in the first place, I'm not sure.

anonymous07’s picture

Subscribe. With the latest Views update 6.x-3.0-alpha3, there don't appear to be any Custom Pager links anymore :(

(Or I haven't figured out the right combination of Views settings to make it work again).

JordanMagnuson’s picture

Subscribing. Definitely interested in using this with Views 3.

bojanz’s picture

Status: Active » Needs review
FileSize
859 bytes

As you know, Views 3 changes the way queries are made, in order to support pluggable query backends.
This apparently doesn't sit well with Custom Pagers.

Here's what you need to do to get it working:
1) Apply the patch (or make the change yourself)
2) Make sure that the View your using (I'm assuming it's a node view) either uses Row Style: Node, or Row Style: Fields with the base field added (in this case Node:nid)
3) ??
4) Profit!

Oh, and please do use the latest dev version of Views 3. Alpha3 is horribly outdated.

Finn Lewis’s picture

Pathch in #4 works for me!

Thanks bojanz!

Anonymous’s picture

Patch #4 works for me too

fictionindustries’s picture

YES! works

anonymous07’s picture

Works for me too.

@ bojanz: I think I put the wrong version, I was using the Dev version. Thanks for the patch!

jjjames’s picture

Patch worked for me... thanks!!

jjjames’s picture

UPDATE: Limit to 10 nodes?

The pager now shows up, but only on the last 10 nodes and I can only navigate back and forth through the last 10 nodes. I have no idea what's causing it. I've tried several different times and end up with the same 10 node limit.

sarvab’s picture

Here is a different patch that accomplishes the same and a bit more:

1) Works regardless of what fields / row styles are used (do not need to add the NID field)
2) Ignores all enabled fields to prevent potential slower-then-necessary queries
3) Forces view to not use a pager to ensure it can look at all results (likely fixes previous comments 10 node limit problem)

GrahamShepherd’s picture

#11 worked for me including fixing the 10 node limit. Many thanks @sarvab.

GrahamShepherd’s picture

Can this patch be added incorporated the next release? It is a pain having to insert it each time on each site whenever there is a module update.

grigorym’s picture

Is it working with view arguments? I'm still unable to make it honor the contextual filter 'OG membership: Group ID' which i'm passing.

Edit: Mea culpa! The view was of type 'page', or something... I've made a brand new view (unchecking 'create page' by the way) and contextual filters worked!