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.
When a node is created by UUID services UPDATE call, the uid property is not set properly.
The proposed solution (patch to follow) introduces a 'uuid_services_update_alter' hook to allow modules to add data to the entity being saved, and implements this on behalf of the node module.
Comment | File | Size | Author |
---|---|---|---|
#8 | uuid-2043273-set-uid.patch | 1.59 KB | skwashd |
|
Comments
Comment #1
wodenx CreditAttribution: wodenx commentedPatch
Comment #2
aoturoa CreditAttribution: aoturoa commentedThis is correctly handled in the standard _node_resource_create() where the 'name' and 'language' are added inside the function. Now that uuid_service module uses _node_resource_update() instead, we can also add the missing values using the standard hook_entity_presave() function:
Comment #3
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedI agree with aoturoa's suggestion.
Comment #4
recidive CreditAttribution: recidive commentedChanged to use
hook_entity_presave()
.Comment #6
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedThanks for that patch. I've merged it. Closing
Comment #7
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedI realised after committing the change, that this logic belongs in
node_entity_uuid_presave()
.Comment #8
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedComment #9
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedThe attached patch resolves the problem.
Comment #10
recidive CreditAttribution: recidive commentedComment #11
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedThanks for the review. Merging.
Comment #13
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commented