Views filtering on Workbench access: access filter doesn't bring in selected section

I have set up workbench access using taxonomy.

I want to filter content in a View based on the taxonomy selection in a content type.
Example:

Content type: Promo message
Workbench access section taxonomy options: study, current students
I create two views of content type promo message.
I want to filter each view by workbench access: access filter.
View 1. filtered by workbench access: access filter: "study"
View 2: filtered by workbench access: access filter: "current students"

I want to display one view on a study section and the other on current students

Steps when adding the workbench access: access filter in:

1. In views click Add filter criteria
2. select Workbench Access: Access filter
3. under operator there is only "Is one of" option
4. Under Sections I select "study" as one of the options
5. Click apply

In the Filter Criteria list, workbench access appears as:

Workbench Access: Access filter (=)

and it displays an error at the top:

Warning: Illegal offset type in unset in views_handler_filter_in_operator->admin_summary() (line 313 of /data/law/sites/all/modules/contrib/views/handlers/views_handler_filter_in_operator.inc).

My selection of "study" or "current students" doesn't appear for the filter criteria to filter on.

I saw a similar issue to this for Workbench access development version 7.x-1.x-dev https://www.drupal.org/node/1284680. I have done research but it doesn't appear anyone else is having this issue with the current stable version

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fionamccaskill’s picture

Issue summary: View changes
agentrickard’s picture

What version of PHP are you running?

dgtlmoon’s picture

Looks like a bug or the API has changed, $this->value returns a single value on nothing selected and a single or an array of values when selected.

dgtlmoon’s picture

Status: Active » Needs review
dgtlmoon’s picture

Last one gave a warning, $this->values is always an int when not set, so we go with that.

jiv_e’s picture

I have the exact same warning. It appears when I have "Workbench Access: Access filter (=)" in use. Everything seems to work correctly, though. I have a different setup. It filters content based on current users workbench access permissions.

The latest patch didn't remove the warning and on the actual view page i now get...

Warning: array_flip(): Can only flip STRING and INTEGER values! in workbench_access_build_tree() (line 1246 of /var/www/clinic/drupal_root/sites/all/modules/workbench_access/workbench_access.module).

I'm using PHP7 Workbench_access-7.x-1.5 (and this patch https://www.drupal.org/files/issues/make_editorial-2667290-2.patch).

agentrickard’s picture

Patch isn't working for me. Looking at solutions.

Warning: array_flip(): Can only flip STRING and INTEGER values! in workbench_access_build_tree() (line 1246 of /Applications/MAMP/htdocs/workbench7/sites/all/modules/workbench_access/workbench_access.module).
agentrickard’s picture

This seems to work. I'm running PHP 7.1 right now.

delacosta456’s picture

hi @agentrickard
on my own side the patch #8 apply correctly but i am still having the filter illegal error message

for info i am on php 5.6.30 , mysql 5.6 WB 7.1.2 , WBA 7.x-1.5+0-dev

agentrickard’s picture

What is the exact error message?

delacosta456’s picture

FileSize
222.48 KB

hi agentrickard

i attached a screenshot for more precision for you

delacosta456’s picture

FileSize
222.48 KB

screenshoot

agentrickard’s picture

Thank you!

agentrickard’s picture

That error is not quite the same as the original one reported. It is probably due to some code-level changes in Views. It's easy to fix here though.

delacosta456’s picture

hi @agentrickard

thanks please how do i do fix that

thanks

agentrickard’s picture

Looking again at the error and the code, it's hard to say, since that error isn't coming from Workbench Access. That error should be filed over in the Views queue.

Workbench Access doesn't use views_handler_filter_in_operator, which is causing the error.

delacosta456’s picture

hi
i will try re porting it to view issue then

thanks

agentrickard’s picture

Status: Needs review » Closed (won't fix)

7.x is closed.