Problem/Motivation
Need to add multiple values for Dependent Facet settings when condition mode is set to: Check whether the facet is set to specific values.
Steps to reproduce
- Create a facet.
- Enable Dependent Facet.
- Enable a condition.
- Set condition mode to: Check whether the facet is set to specific values.
- Enter multiple values in the field.
- Multiple values will only be accepted when listed with a comma separator and no space. If not entered this way, only the first value will work.
Proposed resolution
Need to update line 205 in https://git.drupalcode.org/project/facets/-/blob/2.0.x/src/Plugin/facets... to trim the values.
Remaining tasks
User interface changes
Add help text to the field to tell people how to input multiple values.
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff-7-9.txt | 856 bytes | smustgrave |
| #9 | facets-3279735-9.patch | 1.29 KB | smustgrave |
| #7 | updated-help-text-3279735-7.patch | 1.28 KB | tishmg |
| #6 | replaced-depricated-function-3279735-6.patch | 1.25 KB | jaydev bhatt |
Comments
Comment #2
jaydev bhatt commentedComment #3
jaydev bhatt commentedI have added the field description for the field that appears on the "Dependent Facet - condition mode : Check whether the facet is set to specific values."
and on the same field i have also trimmed the extra white-spaces from both ends right and left
Comment #5
jaydev bhatt commentedComment #6
jaydev bhatt commentedReplaced the array_walk() function with array_map() function.
Comment #7
tishmgI tested out the patch and have verified the trim function works. I have included an updated patch to update the help text.
Comment #8
tishmgNot sure why the patch failed. I tested it on Drupal 9.3 and PHP 8.0. I didn't see a way to change what version of PHP to test against.
Comment #9
smustgrave commentedPatch #7 didn't apply cleanly for me so I rerolled it.
Comment #10
tishmgfacets-3279735-9.patch works for me! Tested on Drupal 9.3.16, php 8.0. Thank you so much everyone for all the work!
Comment #11
smustgrave commentedComment #12
mkalkbrennerComment #14
mkalkbrenner