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.

Comments

apotek’s picture

apotek’s picture

Status: Active » Needs review

Updating to needs review.

markdorison’s picture

This makes a lot of sense for sites that are consuming data from outside sources that are responsible for assigning the uuid.

skwashd’s picture

Status: Needs review » Fixed

Thanks for the patch, I've applied and committed it (da19c48). This will be included in the next released of the UUID module.

Status: Fixed » Closed (fixed)

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