Closed (duplicate)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Feb 2012 at 22:01 UTC
Updated:
13 Feb 2013 at 10:14 UTC
Jump to comment: Most recent file
Comments
Comment #1
googletorp commentedThe problem turned out to be a very simple line of code:
In the commerce_entity_access_query_alter function the base table for the query was found like this:
In some cases this went well, but in other cases this didn't work out as it should, as the table selected as the base table would not be the same as the table used for the entity. When doing stuff like
$conditions->condition($base_table . '.' . $entity_info['access arguments']['user key'], $account->uid);The query could end up being 'commerce_line_item.uid = 2', since line items doesn't have uid the query will fail - but due to the nature of the query it doesn't generate a PDOException.
I have attached a patch that fixes this, you can also see this commit
Comment #2
googletorp commentedUploaded same patch, but without all the junk from Drupal's build system.
Comment #3
mossy2100This didn't solve the problem for me.
Comment #4
googletorp commented#3 Your comment isn't really of much help unless you state a test case where the permission check fails.
Fx when viewing an FOO and the user has permission BAR, BAZ isn't displayed.
Comment #5
googletorp commentedRyan mind if you look at this for 1.3 - I went and made a shameless tag :)
Comment #6
rcross commentedthis sounds like it might be a duplicate of #1276450: Views results empty for unprivileged user when using Relationship: Content: Referenced Product or at least the same root problem #1323366: Query access fails in certain cases on post-RC1 Views
Comment #7
cvangysel commented#2 was the solution I also had in mind ... can anyone give a use-case where this still fails?
Comment #8
rszrama commentedI'm pretty sure this just got fixed as part of the patch in #1879260: More robust query altering for line items. Marking duplicate, but feel free to reopen if I've missed an edge case in here.