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.
If a visiting user attempts to view more articles, all of the article categories will show 0 entries unless that user has administer nodes permission. The following error will be seen in the logs:
user error: query: SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM term_node t INNER JOIN node_access na ON (na.nid = 0 OR na.nid = n.nid)INNER JOIN node n ON t.nid = n.nid WHERE n.status = 1 AND na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0')GROUP BY t.tid in /usr/local/share/drupal-4.5.1/includes/database.pgsql.inc on line 121.
This may be PostgreSQL-specific, but I have no MySQL install to test on.
Comment | File | Size | Author |
---|---|---|---|
#3 | taxonomy_pgsql_1.patch | 969 bytes | Zed Pobre |
#2 | taxonomy_pgsql_0.patch | 0 bytes | Zed Pobre |
#1 | taxonomy_pgsql.patch | 0 bytes | Zed Pobre |
Comments
Comment #1
Zed Pobre CreditAttribution: Zed Pobre commentedIt turns out, this error is coming from taxonomy.module, despite being triggered by article.module (and nowhere else that I can see).
As a first pass approximation, I think we want:
which I have converted from the error statement I'm seeing. I've inverted the INNER JOIN order, putting node n before node_access na. This seems to generate the right results, but I'm not absolutely confident in my SQL at this hour of the morning.
The attached patch to taxonomy.module implements this, fixes the problem with article.module on Postgres, and doesn't *seem* to have any negative side effects as far as I can see. Please see if it looks reasonable to you.
Comment #2
Zed Pobre CreditAttribution: Zed Pobre commentedTrying again to attach the patch.
Comment #3
Zed Pobre CreditAttribution: Zed Pobre commentedOh, right. It's sitting on the other computer (I really wish Drupal would check for 0-byte attachments and throw a warning up somewhere to let you know that something was wrong).
Comment #4
pyromanfo CreditAttribution: pyromanfo commentedHey I don't know if you did this, but I just checked and it's not with my taxonomy.module patch at all, but with the core taxonomy.module. I'll move it over there.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to DRUPAL-4-5.
Comment #6
(not verified) CreditAttribution: commented