Closed (outdated)
Project:
Content Access
Version:
7.x-1.2-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 May 2011 at 12:27 UTC
Updated:
24 May 2020 at 14:48 UTC
Jump to comment: Most recent
Comments
Comment #1
good_man commentedI tried it with book, it's working great, hmmm any more details of how to reproduce it? and what's going wrong? more details means quicker fix.
Comment #2
good_man commentedComment #3
joemaine commentedI think I can define the issue between AC and Book. Book pages appear OK without AC. Book pages appear OK with AC and with the Book Navigation Block disabled - or with the Book navigation block display set to "Show block on all pages ". If "Show block only on book pages" is selected...errors occur. Here's what I find on a site when trying to access a "book" page with the Book navigation block set to Show block only on book pages:
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'nid' in where clause is ambiguous: SELECT DISTINCT n.title AS title FROM {node} n INNER JOIN {node_access} na ON na.nid = n.nid WHERE (nid = :db_condition_placeholder_0) AND(( (na.gid = :db_condition_placeholder_1) AND (na.realm = :db_condition_placeholder_2) )OR( (na.gid = :db_condition_placeholder_3) AND (na.realm = :db_condition_placeholder_4) )OR( (na.gid = :db_condition_placeholder_5) AND (na.realm = :db_condition_placeholder_6) ))AND (na.grant_view >= :db_condition_placeholder_7) ; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => all [:db_condition_placeholder_3] => 0 [:db_condition_placeholder_4] => content_access_author [:db_condition_placeholder_5] => 1 [:db_condition_placeholder_6] => content_access_rid [:db_condition_placeholder_7] => 1 ) in book_block_view() (line 286 of /home3//public_html/modules/book/book.module).
Additional
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'nid' in where clause is ambiguous: SELECT DISTINCT n.title AS title FROM {node} n INNER JOIN {node_access} na ON na.nid = n.nid WHERE (nid = :db_condition_placeholder_0) AND(( (na.gid = :db_condition_placeholder_1) AND (na.realm = :db_condition_placeholder_2) )OR( (na.gid = :db_condition_placeholder_3) AND (na.realm = :db_condition_placeholder_4) )OR( (na.gid = :db_condition_placeholder_5) AND (na.realm = :db_condition_placeholder_6) ))AND (na.grant_view >= :db_condition_placeholder_7) ; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => all [:db_condition_placeholder_3] => 0 [:db_condition_placeholder_4] => content_access_author [:db_condition_placeholder_5] => 1 [:db_condition_placeholder_6] => content_access_rid [:db_condition_placeholder_7] => 1 ) in book_block_view() (line 286 of /home3//public_html/modules/book/book.module).
Comment #4
kmulford1 commentedI received the same SQL error as joemaine. I have the content access module configured to allow all authenticated roles (both the default and a couple of custom roles) to view any node with a content type of 'book'. If I'm viewing a restricted node as a user with an administrator role, I'm able to interact with all of the pages without issue. However, if I log in with a user account assigned to my non-administrator role, I get the SQL below. I do have the Book Navigation block set to display on book pages only.
As a workaround, I've enabled the Book Navigation block on all pages, then restricted the view of that block to the appropriate roles (in the block configuration area), and that seems to have done the trick.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'nid' in where clause is ambiguous: SELECT DISTINCT n.title AS title FROM {node} n INNER JOIN {node_access} na ON na.nid = n.nid WHERE (nid = :db_condition_placeholder_0) AND(( (na.gid = :db_condition_placeholder_1) AND (na.realm = :db_condition_placeholder_2) )OR( (na.gid = :db_condition_placeholder_3) AND (na.realm = :db_condition_placeholder_4) )OR( (na.gid = :db_condition_placeholder_5) AND (na.realm = :db_condition_placeholder_6) )OR( (na.gid = :db_condition_placeholder_7) AND (na.realm = :db_condition_placeholder_8) ))AND (na.grant_view >= :db_condition_placeholder_9) ; Array ( [:db_condition_placeholder_0] => 26 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => all [:db_condition_placeholder_3] => 70 [:db_condition_placeholder_4] => content_access_author [:db_condition_placeholder_5] => 2 [:db_condition_placeholder_6] => content_access_rid [:db_condition_placeholder_7] => 4 [:db_condition_placeholder_8] => content_access_rid [:db_condition_placeholder_9] => 1 ) in book_block_view() (line 286 of /var/www/vhosts/example.com/httpdocs/modules/book/book.module).
Comment #5
good_man commentedFirst please post code inside code tags, second thing I can't reproduce this, are you using the latest Drupal? please write a good how-to reproduce with Drupal core & content access versions number.
Comment #6
kmulford1 commentedI went back to follow the same steps that I'd previously taken after updating to Drupal 7.7 and Content Access 7.x-1.2-beta1. I was unable to recreate and everything worked perfectly. I know I'm not the only one who reported this but I'd mark it closed. Thanks and sorry for not providing more specific steps previously, but it's a moot point for me now.
Comment #7
Mark Nielsen commentedI can confirm I'm this error.
I have Drupal 7.7 installed, and Content Access 7.x-1.2-beta1. I had previously installed Book Access, but found that this also had a "show-stopping" bug. So I disabled and completely uninstalled Book Access and Installed Content Access instead.
Also, loading of the page partially fails, so that under this error message, Drupal reports, "The website encountered an unexpected error. Please try again later."
* I think "View any book content" is a confusing title as it made me wonder if I was updating Access Control for this specific node, or for the Book Page content type generally. But this is perhaps another (much less critical) issue :)
Comment #8
kenianbei commentedI can also confirm this, The fatal error happens when the book block is enabled.
Comment #9
kenianbei commentedAlso wanted to add that any users with 'Bypass content access control' perm will not get this error.
Comment #10
wipeout_dude commentedsubscribing with the same error..
Comment #11
david@thrale.com commentedI also get this problem for anonymous users only. The workaround is to select "Show block on all pages" and then under VisibilitySettings, choose the Content Types tab and select "Book". This has the same effect and it eliminates the errors.
Comment #12
gisle