Problem/Motivation
The current hooks for node/term bundles can be condensed into a single hook using hook_form_alter() and an array of IDs to alter. Similarly the code in the validator can use core methods to be made generic without needing a switch(). This makes it easy to add support for new entity types.
Proposed resolution
Attached patch makes the form alter and field validator generic, and adds support for Media types.
Remaining tasks
Add an install file and update hook to convert old config schema re: taxonomy to new format - i.e. convert all unique_entity_title.settings.${vocab_name}_taxonomy_unique values to third-party settings on taxonomy.vocabulary.${vocab_name}
| Comment | File | Size | Author |
|---|---|---|---|
| unique_entity_title-use_core_methods_and_add_media.patch | 9.19 KB | bgilhome |
Issue fork unique_entity_title-3220848
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
anybody@bgilhome really nice work and cleanup! Could you maybe turn this into a MR instead of a patch to proceed more easily?
Comment #5
miroslavstankov commentedI created a MR based on the existing patch. Could someone take a look and let me know if everything looks correct or if I missed anything? Thanks!
Comment #6
anybodyThanks @miroslavstankov! That sounds great! Would you also like to address #3557169: Add basic install tests, gitlab CI, Tugboat and composer.json with dependencies maybe? Then we'd have a cleaner start here!
Comment #7
miroslavstankov commentedYes, i will take a look.
Comment #9
i-trokhanenkoThanks!