Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Modr8 block is showing a wrong number of posts in moderation queue.
I've found the error is generated in the query modified by the presence of the node_access module.
I've only one moderated post, but the block shows I've 3.
Once "db_rewrite_sql" (either in the block and page functions) is called, the query generated is:
SELECT COUNT(*) FROM {node} n INNER JOIN {node_access} na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'nodeaccess_rid') OR (na.gid = 14 AND na.realm = 'nodeaccess_rid') OR (na.gid = 7 AND na.realm = 'nodeaccess_uid') OR (na.gid = 7 AND na.realm = 'nodeaccess_author'))) AND ( n.status = 1 AND n.moderate = 1)
The result is 3 rows...
I've not so deep knowledge to investigate the issue.
Comments
Comment #1
mike1966 CreditAttribution: mike1966 commentedOops, small correction. the table node_access accessed, is from the core of drupal, not from the nodeaccess module
Comment #2
pwolanin CreditAttribution: pwolanin commentedperhaps that should be instead
COUNT(DISTINCT(nid))
Comment #3
jean-bernard.addor CreditAttribution: jean-bernard.addor commentedIs that forum topic a duplicate:
http://drupal.org/node/300937
Comment #4
mike1966 CreditAttribution: mike1966 commentedIt doesn't seem the same topic.
So far I remember, the http://drupal.org/node/300937 issue, was related to the format_plural call.
I tried the suggestion of pwolanin. It works, with a small correction:
COUNT(DISTINCT(n.nid))
Thanks pwolanin