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

  1. Assess the complexity of adding the feature
  2. If technically viable, design an update interface
  3. Implement in code
Command icon 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

cedewey created an issue. See original summary.

srdtwc made their first commit to this issue’s fork.

srdtwc’s picture

Implemented 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.

cedewey’s picture

Status: Active » Needs review
broon’s picture

Status: Needs review » Needs work

I 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?

srdtwc’s picture

Yes I believe that's the same difficulty I was having. I was only able to get this working with a text field.

srdtwc’s picture

StatusFileSize
new2.17 KB

Here 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

joao.ramos.costa made their first commit to this issue’s fork.

joao.ramos.costa’s picture

Status: Needs work » Needs review
StatusFileSize
new6.37 KB

Dear,

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!

joao.ramos.costa’s picture

Dear @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 :)

  • broon committed e91a0cf5 on 2.x
    [#3251919] feat: Allow the selection of multiple vocabularies
    
    By:...
broon’s picture

Status: Needs review » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

joao.ramos.costa’s picture

Dear @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.

broon’s picture

Sorry, I thought I had done it on all tickets I worked on two weeks ago. It's fixed now.

joao.ramos.costa’s picture

Thank you