I set up a taxonomy and an access scheme as described in the documentation and selected all content types to have WA enforced. All users have been added to different sections and can create content accordingly.

I can setup views with filters restricting to the content of one section, but it shows the content of all sections. Filtering a view to a certain section works only if an exposed filter is used.

Here is what the views-preview shows as databas-query:

SELECT node.created AS node_created, node.nid AS nid
FROM 
{node} node
WHERE (( (node.status = '1') AND (node.nid IN  (SELECT DISTINCT workbench_access_node.nid AS nid
FROM 
{workbench_access_node} workbench_access_node
WHERE  (workbench_access_node.access_id IN  ('department', '1', '2', '9', '8', '10', '11', '12', '14', '13')) AND (workbench_access_node.access_scheme = 'taxonomy') )) ))
ORDER BY node_created DESC
LIMIT 10 OFFSET 0
CommentFileSizeAuthor
#7 wba-views-filter-1284680-7.patch1.67 KBfearlsgroove

Comments

agentrickard’s picture

Title: filtering Views with Workbench Access: Access Filter doesn't work » Views filter only works when exposed
Status: Active » Postponed (maintainer needs more info)

Interesting. Our only use-case has been for an exposed filter, so that's likely why we never saw this behavior.

Which version of Views are you using?

Note: better title.

ronny89’s picture

Views is version 7.x-3.0-rc1
ctools is version 7.x-1.0-rc1

i'll try another WA-setup with default sections from scratch now and give feedback whether it works.

thanks for tightening the title. :-)

ronny89’s picture

it's the same with the example configuration.

here, Exhibits Visiter and Exhibits Staff (explicitly) are chosen as filter, but content assigned to other sections is also shown:

SELECT node.created AS node_created, node.nid AS nid
FROM 
{node} node
WHERE (( (node.status = '1') AND (node.type IN  ('article', 'event')) AND (node.nid IN  (SELECT DISTINCT workbench_access_node.nid AS nid
FROM 
{workbench_access_node} workbench_access_node
WHERE  (workbench_access_node.access_id IN  ('workbench_access', '15', '17', '16', '18', '20', '19', '21', '23', '22')) AND (workbench_access_node.access_scheme = 'taxonomy') )) ))
ORDER BY node_created DESC
LIMIT 7 OFFSET 0
agentrickard’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks. I suspect that we're only applying to exposed filters, so we need to take a look at how that filter handler operates.

robeano’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Assigned: Unassigned » stevector

Let's see if we can get this fixed. Assigning to @stevector

ronny89’s picture

with #1187424: Default taxonomy form support i can create views with desired results.

fearlsgroove’s picture

Status: Active » Needs review
StatusFileSize
new1.67 KB

This is broken for non-exposed forms because it relies on trickery with the form fields instead of a simple 'value' field. I've attached a patch that fixes it by assigning the value based on the access_id setting in an init() override, which also required I define get_value_options(). It works with both exposed filters and explicit non-exposed filters, but I don't fully grok the intent of the trickery I'm working around, so this may bear some additional rethinking.

agentrickard’s picture

Confirmed. Thanks!

Committed.

agentrickard’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Lehtóri’s picture

After applying the above patch, i get the following warning at my views config page. The view itself seems to work fine though.

Warning: Illegal offset type in unset in views_handler_filter_in_operator->admin_summary() (regel 304 van <path to drupal>/sites/all/modules/views/handlers/views_handler_filter_in_operator.inc).