Problem/Motivation
The current implementation of uuid_taxonomy will bounce out of the hook if there is either no vid (correct), or if uuid_automatic_for_taxonomy is off for the given vocabulary (too limiting).
If a term *has* a uuid, it should still be able to insert/update it's values, even if the drupal install has uuid_automatic_for_taxonomy set to off for that vocabulary. The logic here is: if my site has uuid_automatic_for_taxonomy I don't want uuids for my taxons, however, if an incoming taxon (via a migration or other import) DOES have a uuid, I should still record that data, shouldn't I?
Proposed resolution
The proposed solution is to bounce out of the hook only if:
1. no vid (nothing to be done here, folks) on term.
2. uuid_automatic_for_taxonomy is off and there is no uuid property on the taxon.
This means that the logic needs to check not only for the uuid_automatic_for_taxonomy setting, but also if the incoming term has a uuid property.
Remaining tasks
Patch to be provided and reviewed.
User interface changes
none.
API changes
Site administrators do not need to turn on uuid_automatic_for_taxonomy in order to receive a uuid for a term that is coming from some external source.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | no_update_if_uuid_automatic_for_taxononmy_if_off_even_with_uuid-1608914-1.patch | 949 bytes | apotek |
Comments
Comment #1
apotek commentedAnd here's the patch.
Comment #2
apotek commentedUpdating to needs review.
Comment #3
markdorisonThis makes a lot of sense for sites that are consuming data from outside sources that are responsible for assigning the uuid.
Comment #4
skwashd commentedThanks for the patch, I've applied and committed it (da19c48). This will be included in the next released of the UUID module.