This very old issue is still here in D8.8.5.
There is a long D7 conversation about this issue, but since there is no D8 issue (or I couldn't find it) I decided to create one... as hope for resolve in D7 is fading.
To reproduce inside clean D8 installation:
- Create few articles and basic pages.
- Inside core Content view edit "Content type" filter.
- Select Article content type only and choose "Limit list to selected items".
- Visit
/admin/content
. Exposed filter contains only Article content types which is proper, but all content is returned in the view results list including basic pages.
Screenshot attached.
The behavior can be reproduced with any other exposed filter as well. Trying to limit Vocabulary exposed filter to certain Terms for example.
TEMPORARY SOLUTION: Adding another - not exposed content type filter - with Article content type selected only (which removes Basic Pages from view results list) is popular workaround all these years.
However, 11 years passed since this views issue is reported, and D9 is just around the corner... it would be nice to gift ourselves the fix. :)
Comment | File | Size | Author |
---|---|---|---|
content-type-filter.jpg | 132.51 KB | devad |
Issue fork drupal-3132725
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
Ashutosh.tripathi CreditAttribution: Ashutosh.tripathi commentedHi @devad,
As the statement "Limit list to selected items" states that it should limit the items shown in the dropdown. It seems to be working fine as its properly filtering the dropdown. This checkbox "Limit list to selected items" only meant to limit the dropdown list not the result set as its an exposed filter and will act only when you select something. Hope this makes sense!
Thanks
Ashutosh
Comment #3
dwwMore accurate category and status.
Thanks,
-Derek
Comment #4
dwwp.s. If you don't want the '- Any -' choice (which is what's giving you grief), you have to set that exposed filter to be 'Required'. That's really the problem you're hitting...
Comment #5
devad CreditAttribution: devad as a volunteer commentedThank you all for kind replies and help in understanding the real meaning of checkbox title and description.
Due to not so precise use of words in checkbox title and description for all drupalers who will come for the first time to this checkbox in the future - there will always be two ways how they can understand checkbox functionality.
So, I have opened separate issue as follow-up to this one... a small initiative to slightly alter checkbox description in order to make its meaning more precise and to avoid any further misunderstandings about its proper use.
Please, feel free to join: #3133906: "Limit list to selected items" checkbox - Title and description adjusting
Comment #6
steyep CreditAttribution: steyep commentedUnderstanding that this is working as intended but the InOperator filter contains code that should limit the "all" filter to the selected items:
The related exposed filter form is assigning that value to
reduce
instead oflimit
:So, one possible work around would be to alter the value in a pre build hook:
Comment #7
devad CreditAttribution: devad as a volunteer commentedThis bug (which has evolved into feature) is still around although Views joined the Drupal core many years ago.
Let's assign the "Bug smash initiative" to this issue and see if the Bug smash initiative team has will to deal with it.
It would be great to have Views cleaned up from this ugly 14 years old bug before D11 is released. :)
The issue below has a working D7 patch witch depicts nicely the original
'reduce' -> 'limit'
typo-mistake which caused this bug to appear 14 years ago:#1309578: When using operator "Is one of" and "Limit list to selected items" - 'Any' should not ignore the selected items.
I am willing to help with manual tests and feedbacks as much as I can.
Comment #8
devad CreditAttribution: devad as a volunteer commentedAdditionally... it would be nice if we can make here the "Limit list to select items" option to work nicely with "Is not one of" operator as well... which is not the case currently... but of course, it can be done in the separate issue as well.
Comment #9
quietone CreditAttribution: quietone at PreviousNext commentedOccasionally, I check the Drupal 8 issue queue and today was one of those days. Since Drupal 8 is no longer supported I am moving this to 11.x where it will be seen by the community. I am also removing the bug smash tag because that is added after the Bug Smash Initiative has triaged an issue.
Comment #13
Carlos Romero CreditAttribution: Carlos Romero at Hiberus commentedGood morning everyone.
Comment #6 is right, I have tried what he says and he is right, thank you very much steyep.
I have created a fork branch and done mr to 10.2.x and 11.x.
Greetings to all.
Comment #14
Carlos Romero CreditAttribution: Carlos Romero at Hiberus commentedComment #15
smustgrave CreditAttribution: smustgrave at Mobomo commentedThanks for working on this old one.
Can the issue summary be updated using the standard issue template please
Changed to a bug as support requests typically don't have code fixes. But will need a test case showing the issue.