Hi,

Thank you so much for this module - it has just made a nightmare incredibly easy. I am using it for multiple views and its working without error... except for one strange thing.

My pagers don't seem to be working. If I have a view which is showing 10 results and I simply turn on the pager and make it show 2 results, I expect to see 5 pages like I do with my normal views. With this I see no pager, just the first 2 results.

Does anyone else see this?

Thanks,
Paul.

Comments

markus_petrux’s picture

It works here. So it could be something particular to your installation, or maybe something special in this view that brakes the joins that this module builds.

Try debugging the queries executed (using the devel module) and see how the SQL statement from the main query of this view changes from one page to another.

markus_petrux’s picture

Title: Wicked! (And Possible bug?) » Issue with Views pagination
techypaul’s picture

Hi,

I apologise for being a noob, but I have installed the devel module but I cant see what I should be looking for. I get a whole load of queries, caches etc at the bottom of the page but cannot see anything showing the SQL output of this view. Is there something in particular I should be looking for?

I know you are very busy so appreciate your advice.

Thanks,
Paul.

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

You can first see how the query looks in the Views UI, and that should give you the pattern to look into the list of queries provided by devel module.

singularo’s picture

I had this as well, and figured it out, in my case, i was using the backreference to heavily, and when the "count" query was run by views to get the number of rows returned, it adds "distinct" and since all the rows were for one node (with multiple backreferences), it only returned 1. This was the query:

SELECT COUNT( *  )
  FROM (
    SELECT DISTINCT node.nid AS nid
    FROM node node
    LEFT JOIN (
      content_field_group_ref node_data_field_group_ref
      INNER JOIN node node_node_data_field_group_ref ON node_data_field_group_ref.vid = node_node_data_field_group_ref.vid
    ) ON node.nid = node_data_field_group_ref.field_group_ref_nid
    WHERE (
      node_node_data_field_group_ref.type
      IN (
        'contact'
      )
    )
    AND (
      node.nid =1489
    )
  ) count_alias

So, I had to re-think the view, sort of reverse the relationship/criteria, and the query now looks like:

SELECT COUNT( *  )
  FROM (
    SELECT DISTINCT node.nid AS nid
    FROM node node
    LEFT JOIN content_field_group_ref node_data_field_group_ref ON node.vid = node_data_field_group_ref.vid
    LEFT JOIN node node_node_data_field_group_ref ON node_data_field_group_ref.field_group_ref_nid = node_node_data_field_group_ref.nid
    WHERE (
      node.type
      IN (
        'contact'
      )
    )
    AND (
      node_node_data_field_group_ref.nid =1489
    )
  ) count_alias

And correctly gives the right number of rows - 22

Now there is in fact no backreference usage at all, just using the "group" relationship (which i was backreferencing before) in the argument. This is probably much more efficient as well ;-)

HTH

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Fixed

It looks like this is fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dunx’s picture

I don't believe the solution offered is a fix.

If you use a reverse node reference to display nodes referring to a given node, then you must use the relationship field on the row style configuration to return the referencing nodes. If not, you just end up with multiple copies of the referenced node. The pager count SQL is not taking in to account this relationship and the DISTINCT is always returning 1 - the node referenced, rather than the number of referencing nodes.