Problem/Motivation
We get this issue when we select multiple taxonomies in view filter.
Steps to reproduce
Drupal view term filter only allows you to filter on terms from a single vocabulary. There is a patch to overcome this issue.
Issue link : https://www.drupal.org/project/drupal/issues/2784233
When we apply patch, It change keys from "vid" to "vids". SHS module loading term based on vid.
It throws error for undefined key after applying patch.
Warning: Undefined array key "vid" in Drupal\shs\Plugin\views\filter\ShsTaxonomyIndexTid->valueForm() (line 48 of /usr/local/apache2/htdocs/web/modules/contrib/shs/src/Plugin/views/filter/ShsTaxonomyIndexTid.php)
Proposed resolution
Update the key from "vid" to "vids" and load multiple vocabularies.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | update_key_vid_3383731-2.patch | 1.35 KB | harshit ghediya |
Issue fork shs-3383731
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
harshit ghediya commentedUpdated the key "vid" to "vids" in file "ShsTaxonomyIndexTid.php"
Comment #3
harshit ghediya commentedComment #4
xurizaemonThis proposed change depends on changes in #2784233: Allow multiple vocabularies in the taxonomy filter which are currently marked for a future Drupal version. Therefore I think this change can't be considered as-is.
To be considered, this issue's patch/MR should either incorporate code to handle both current and future Drupal (vid OR vids), OR update SHS requirements to depend on some future version of Drupal where #2784233: Allow multiple vocabularies in the taxonomy filter has landed (TBC).
Marking "needs work" accordingly.
Comment #5
xurizaemon