Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When trying to save a view with a permission filter on it I get the following message:
No valid values found on filter: User: Permission.
This blocks me from saving the view.
Steps to reproduce
- Create a new user view
- Add a permission filter and select a permission to filter on
- Try to save the view
Proposed resolution
This is happening because the permission filter handler returns a multidimensional array as valueOptions
.
While InOperator
expects a single dimension array while looping through the selected values to verify that they exist.
Before checking if the value exists, reform the multi-dimensional array to a single dimension in InOperator
Remaining tasks
None
Beta phase evaluation
Issue category | Bug because normal usage of the UI gives a false warning and blocks saving |
---|---|
Issue priority | Normal, because only isolated impact |
Prioritized changes | The main goal of this issue is to fix a bug |
Disruption | Not disruptive as it only alters data to a form that was required for proper workings of a method |
Comment | File | Size | Author |
---|---|---|---|
#16 | 2561973-16-complete.patch | 4.22 KB | geertvd |
#16 | interdiff-2561973-14-16.txt | 518 bytes | geertvd |
#14 | 2561973-14-complete.patch | 4.16 KB | geertvd |
#14 | 2561973-14-test.patch | 2.39 KB | geertvd |
#14 | interdiff-2561973-4-14.txt | 1.82 KB | geertvd |
Comments
Comment #2
geertvd CreditAttribution: geertvd at XIO commentedComment #3
geertvd CreditAttribution: geertvd at XIO commentedComment #4
geertvd CreditAttribution: geertvd at XIO commentedAdded a test for this
Comment #6
dawehnerInteresting
Is this something we have to backport to D7?
Comment #7
geertvd CreditAttribution: geertvd at XIO commentedThis isn't an issue in D7 at the moment since
valueOptions
is not a multidimensional array there.Comment #8
DuaelFrThank you @geertvd for that patches!
Coding standards are OK.
Tests are OK.
Patch fixes the bug (see below).
Before
After
Comment #9
LendudeAdded beta eval, patch looks good.
Comment #10
LendudeComment #11
jibran+1 LGTM
Comment #12
olli CreditAttribution: olli commentedIsn't this
$flat_options
?Comment #13
geertvd CreditAttribution: geertvd at XIO commentedYes it should be, and that means that we need more test coverage there. Working on that.
Comment #14
geertvd CreditAttribution: geertvd at XIO commentedThis should add enough test coverage.
Comment #15
LendudeLooking at other user views tests this should be @group user
And maybe add a @see to the permissions filter handler?
Since this is testing UI strings, should the text be wrapped in t()? Not sure what the standard is, I see existing tests with and without t(), but running them through t() would make sense.
Comment #16
geertvd CreditAttribution: geertvd at XIO commentedFixed #15.1
I think this only necessary when we are actually testing something multilingual.
Comment #18
LendudeManually tested that 'select multiple values' scenario, and that works.
Looks good to go again then.
Comment #19
alexpottCommitted ed9b912 and pushed to 8.0.x. Thanks!
Thank you for adding the beta evaluation to the issue summary.