Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the hook_nodeapi, there is not check to see if the node exists in the 'uuid_automatic_for_nodes' variable. When doing a node_save programatically, it is generating UUIDs for things even when it shouldn't. To fix this wrap nodeapi like so:
<?php
function uuid_nodeapi(&$node, $op, $teaser, $page) {
$automatic_types = variable_get('uuid_automatic_for_nodes', array());
if ($automatic_types[$node->type]) {
switch ($op) {
// ...
}
}
}
We are checking to make sure the node->type exists in the automatic_types array before doing *anything*
Comments
Comment #1
phayes CreditAttribution: phayes commentedGah! The code didn't format correctly, let's try again:
Comment #2
skwashd CreditAttribution: skwashd commentedThanks for the bug report. I went for a slightly different approach in commit fbfa077. This has been fixed and will be included in the next nightly build and official release.
Comment #3
skwashd CreditAttribution: skwashd commentedFixing status.
Comment #5
ryan_courtnage CreditAttribution: ryan_courtnage commentedIMHO, the fix for this issue is incorrect (and it breaks my app, and probably others).
Isn't the addition of "Return early if we don't automatically generate UUIDs for this type" at odds with the code a little further down (line 42 of uuid.module)?
Comment #6
apotek CreditAttribution: apotek commentedFixed typo in the title to make the issue more findable on search.
Comment #7
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting 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.