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
Comment | File | Size | Author |
---|---|---|---|
#12 | WB_patched_error.png | 222.48 KB | delacosta456 |
#11 | WB_patched_error.png | 222.48 KB | delacosta456 |
#8 | 2528698-workbench-views-access-filter-selected-section_8.patch | 1.13 KB | agentrickard |
#5 | 2528698-workbench-views-access-filter-selected-section.patch | 981 bytes | dgtlmoon |
#3 | 2528698-workbench-views-access-filter-selected-section.patch | 965 bytes | dgtlmoon |
Comments
Comment #1
fionamccaskill CreditAttribution: fionamccaskill commentedComment #2
agentrickardWhat version of PHP are you running?
Comment #3
dgtlmoon CreditAttribution: dgtlmoon commentedLooks 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.
Comment #4
dgtlmoon CreditAttribution: dgtlmoon commentedComment #5
dgtlmoon CreditAttribution: dgtlmoon commentedLast one gave a warning, $this->values is always an int when not set, so we go with that.
Comment #6
jiv_e CreditAttribution: jiv_e as a volunteer and commentedI 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).
Comment #7
agentrickardPatch isn't working for me. Looking at solutions.
Comment #8
agentrickardThis seems to work. I'm running PHP 7.1 right now.
Comment #9
delacosta456 CreditAttribution: delacosta456 commentedhi @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
Comment #10
agentrickardWhat is the exact error message?
Comment #11
delacosta456 CreditAttribution: delacosta456 commentedhi agentrickard
i attached a screenshot for more precision for you
Comment #12
delacosta456 CreditAttribution: delacosta456 commentedscreenshoot
Comment #13
agentrickardThank you!
Comment #14
agentrickardThat 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.
Comment #15
delacosta456 CreditAttribution: delacosta456 commentedhi @agentrickard
thanks please how do i do fix that
thanks
Comment #16
agentrickardLooking 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.Comment #17
delacosta456 CreditAttribution: delacosta456 commentedhi
i will try re porting it to view issue then
thanks
Comment #18
agentrickard7.x is closed.