Problem/Motivation
If a taxon has a uuid assigned, but it's empty, it *cannot* currently be updated by the uuid_taxonomy update $op.
Steps to reproduce. 1. Set a taxon's uuid to empty. 2. Try to update it. It will not update, which means, you can't fix deleted data.
This is a similar issue to the one I reported in #1599496: On $op update: if uuid value was empty in node_uuid table, uuid module assumes NO uuid and attempts sql INSERT, which fails.
Proposed resolution
The current code in the update op of the hook does this:
<?php
$existing_uuid = db_result(db_query("SELECT uuid FROM {$table} WHERE $keyfield = %d", $key));
if ($existing_uuid) {
?>My proposal is to only test for a failed request (ie, NO row, rather than an empty row, by changing the test.
<?php
$existing_uuid = db_result(db_query("SELECT uuid FROM {$table} WHERE $keyfield = %d", $key));
if ($existing_uuid!==FALSE) {
?>This will allow even an empty row to be updated/repaired, and will not affect any other functionality.
Remaining tasks
Patch to be provided and tested.
User interface changes
none.
API changes
none.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | uuid-no_update_if_taxons_uuid_is_empty-1608890-4.patch | 925 bytes | apotek |
| #4 | uuid-no_update_if_taxons_uuid_is_empty-1608890-4.patch | 925 bytes | apotek |
| #1 | no_taxonomy_uuid_update_if_existing_taxon_uuid_is_empty-1608890-1.patch | 932 bytes | apotek |
Comments
Comment #1
apotek commentedAnd here's the patch for this issue.
Comment #2
markdorisonI would add spaces around the operator on the following line to comply with coding style standards:
if ($existing_uuid!==FALSE) {Otherwise, this looks good to me.
Comment #3
skwashd commentedI agree with @markdorison on this one. You need a space either side of the comparison operator. Other than that I'd be happy to apply it.
Comment #4
apotek commented@skwashd I'm happy to re-roll this patch with your suggestions.
/me re-rolls
Here you go....
Comment #5
apotek commentedOk. This got stuck too. Trying again.
[Update:] Evidently these tests are postponed because the 6.x-1.x branch of the uuid module is failing tests.
Comment #6
apotek commented@skwashd The dev branch of this module is marked unstable for failed tests, so no further tests can be run on patches against the branch. We're stuck. Do you need help getting the dev branch stable?
Comment #7
apotek commented*crickets*
Comment #8
skwashd commentedDrupal 6 core is no longer supported. We are no longer supporting 6.x-1.x versions of this module. I am closing this issue as won't fix.