I have a site with multiple vocabularies which I would like to apply Onomasticon features to. It would be great to be able to designate multiple vocabularies as "Glossary" vocabularies.
Remaining Work
- Assess the complexity of adding the feature
- If technically viable, design an update interface
- Implement in code
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | onomasticon-3251919-13.patch | 6.37 KB | joao.ramos.costa |
| #10 | onomasticon_multiple_vocabs2.patch | 2.17 KB | srdtwc |
Issue fork onomasticon-3251919
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 #6
srdtwc commentedImplemented this functionality. I was unable to get this working with a select element, I think due to the unique configuration requirements of FilterBase. I ended up replacing it with a text field, and providing the user with a list of vocabularies in the description.
Comment #7
cedeweyComment #8
broonI finally got to work on this again. It does work as expected, the only drawback is that I can't get the filter settings to be a list of checkboxes for selecting the vocabularies. The "onomasticon_vocabulary" can be an array, but as the vocabulary maschine names are not known in advance, the schema fails upon saving, with something like
InvalidArgumentException: The configuration property filters.filter_onomasticon.settings.onomasticon_vocabulary.glossary doesn't exist.
Anybody got an idea on how to fix that? Do I need to write a custom plugin annotation class?
Comment #9
srdtwc commentedYes I believe that's the same difficulty I was having. I was only able to get this working with a text field.
Comment #10
srdtwc commentedHere is a reroll of MR3 as a patch against the 2.2.1 release for anyone who needs it in the interim
I've changed the textfield to a textarea to allow for more vocabularies to be listed
Comment #13
joao.ramos.costa commentedDear,
here's a updated suggestion (patch from MR14 https://git.drupalcode.org/project/onomasticon/-/merge_requests/14 ) with some fixes from #10 and tackle @broon concerning from #8. Namely:
- filter schema.
- Update hook to existing instances to new schema settings.
- Single hook_onomasticon_terms with all loaded terms.
- Form checkboxes instead of select for vocabularies.
- Settings form validation to prevent empty vocabularies or vocabulary set when filter is disabled.
Cheers!
Comment #14
joao.ramos.costa commentedDear @broon, any thoughts on #13 patch ?
I'd move forward with this, the changes seem pretty straightforward and adding the schema allows use in Drupal 10.3+. By chance when updating I didn't notice because I already had the patch, but the schema is necessary.
thx :)
Comment #16
broonComment #19
joao.ramos.costa commentedDear @broon would it be possible to complete the credits to reflect the various contributions ?
Not asking just for myself, but as a reminder that contributing takes time, helps improve things, and recognition really supports ongoing collaboration! Thank you for merging.
Comment #20
broonSorry, I thought I had done it on all tickets I worked on two weeks ago. It's fixed now.
Comment #21
joao.ramos.costa commentedThank you