When attempting to save a revision as a new record by uuid, entity_uuid_save() will change the revision flag to 0 (since the vid isn't set because the vuuid doesn't exist, but the is_new flag is turned off because the UUID does exist in the database) in entity_make_entity_local() before it calls entity_save(), and therefore the node will only get updated and revisions will not be saved.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | save_node_new_revision-1890666.patch | 811 bytes | timaholt |
Comments
Comment #1
getweed commentedComment #2
skwashd commentedUpdating fields to reflect the correct information for the issue.
@getweed are you planning on fixing this issue? If not please unassign it from yourself.
Comment #3
timaholt commented@getweed what is your use case here? I'm about to work up a patch to change this behavior if the vuuid does exist if the revision is being pushed in via deploy. It's easy enough to check for isset($entity->{$vuuid_key}) and then flick the revision switch to 1, but that is the use case I have for it. It sounds like you have a use case where you are saving the node without a vid or vuuid, but still want to force a revision?
Comment #4
timaholt commentedOk attached is a patch that will see if the content type has revisions enabled by default, and then change $entity->revision to 1 if that is the case. This should work for both of our use cases. Can you review?
Comment #5
dixon_Simple fix. Committed. Thanks.
Comment #6
dixon_I ended up moving this code to a place that I thought made more sense. Please see: http://drupalcode.org/project/uuid.git/blobdiff/0dafb9f59b171adba74aea13...
Edit: I also added some tests.