Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
book.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2011 at 23:14 UTC
Updated:
29 Jul 2014 at 19:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
agentrickardThis is a bug in core Book module, which is not aliasing it's field correctly. This query is generated by the Drupal 'node_access' query tag.
Try the attached.
Comment #2
agentrickardBetter title.
Comment #4
agentrickardThose test fails are totally unrelated to this patch.
Comment #5
mr.baileysProbably needs a test too...
Comment #6
agentrickardBy that standard, any node select query in core needs a test with node access turned on.
Comment #7
Mo commentedWhen I applied the above patch, I got this error.
Comment #8
Mo commentedComment #9
Mo commented#1: 1013864-book.patch queued for re-testing.
Comment #10
Mo commentedI think I fixed it. I don't know how to create a patch. But this is what I did after applying the patch.
$select->addField('n', 'node', 'title');
to
$select->addField('n', 'title');
Comment #11
agentrickard@Mo:
That's actually confusing this issue, sorry. There are two things happening here.
Your original post is a query alter run by the Node module, which is a core bug.
The second post (in #7) is the implementation of domain_node_access_query_alter(), which is a different issue and would need to be altered after the core patch lands.
For right now, we have to fix #1 first, in core.
Comment #12
agentrickardSetting proper status.
@Mo: http://drupal.org/patch/create Where did you make that edit?
Comment #13
agentrickardFound the change. Let's just make this query syntax match that from node_page_default().
@Mo -- for core, you can only set a patch file to 'needs review'.
Comment #14
Mo commentedOh! I didn't mean to change the status. I guess I just hit submit without looking at the status field while commenting.. hehe I'm still a newbie. :D
Comment #15
agentrickardNot a problem. "Needs review" sends the latest patch to the automated testing system.
Comment #16
jody lynnComment #17
JimmyAx commentedThis patch worked great for me and is very clean.
Comment #18
mariusz.slonina commentedRTBC++
Comment #19
yukare commentedThe path at #17 woks for me
Comment #20
nijadzak commented#17 worked for me
Comment #21
barwonhack commentedYep #17 is a winner. Thanks JimmyAx.
Comment #22
eric.chenchao commentedsubscribe
Comment #23
goshangai commented#1: 1013864-book.patch queued for re-testing.
Comment #24
catchComment #25
hswong3i commentedsubscribe
Comment #26
dries commentedI committed the patch in #13 to 7.x and 8.x. The patch in #17 looked good too, but is less consistent with the rest of core. Thanks!
Comment #27
Anonymous (not verified) commented@Dries: that fix from #13 has problems. Please see #1109852: Ambiguous column name from db_select()->fetchField and #589552: Drupal 7 version of Support Ticketing System
The fix should be change this:
to this
Best regards!
Comment #28
Anonymous (not verified) commentedComment #29
catchWill need to go into 8 first.
Comment #30
JimmyAx commentedAttaching patch.
Comment #31
JimmyAx commentedAnd we probably need it to be reviewed...
Comment #32
agentrickardFair enough. (I wrote #13 and was a bit confused by alias usage in DBTNG.
Comment #33
webchickOK, we already committed one fix without tests, and doing this caused more brokenage. So this time, we need tests.
There's a node_access_test.module you may be able to enable in setUp() in order to to trigger the error, not sure...
Comment #34
sunThe remaining bug in this issue might be annoying (when using certain contrib modules), but it's no longer major.
Comment #35
AdamGS commentedsubscribe
Comment #36
hswong3i commentedI just check with latest Drupal 7.4 but fond that this bug still exists. Here is the rework version for drupal-7.x GIT.
Tested with node_access and all works fine.
Comment #37
yukare commentedI have the same issue in drupal 7.4, and the patch at #36 fixes it using acl + content access
Comment #38
catchPlease don't change version numbers, we fix in the highest affected version then backport.
Comment #39
hswong3i commentedPatch via drupal-8.x-dev GIT.
Comment #40
catchThis is a duplicate of #766382: Column 'nid' is ambiguous when using node access modules which has /exactly/ the same patch on it.