One of the arguments to entity_uuid_load is $conditions, which just get passed onto the core entity_load (and then to the core query() function in core.entity.inc). This is a problem when you want to load a specific revision of a node (or other revisionable entity) by vuuid, since the core query() function actually assumes that all conditions are against the base table instead of the revision table.
In theory, you can work around this by calling entity_uuid_load with an entity's UUID while using $condition['vid'] => $vid but conceptually it doesn't make sense to have to use a regular version id when trying to load via uuid. So I've written a patch that will allow a $condition['vuuid'] to be passed in, and translate that inside the entity_uuid_load into the revision id so that the entity at that specific revision can be loaded. This is meant to be used in conjunction with the deploy-revisions branch of the deploy module so that you can deploy multiple revisions via deploy.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | entity-uuid-load-with-vuuid-3.patch | 1.47 KB | timaholt |
| #2 | entity-uuid-load-with-vuuid-2.patch | 1.38 KB | timaholt |
| entity-uuid-load-with-vuuid.patch | 1.36 KB | timaholt |
Comments
Comment #1
timaholt commentedComment #2
timaholt commentedUpdating patch to avoid php notices when a revision uuid is not defined for an entity.
Comment #3
timaholt commentedOne more time, last patch didn't fix the notice, this one does.
Comment #3.0
timaholt commentedfixing typo 'of'
Comment #4
dixon_Committed. Thanks.
Edit: I accidentally committed a syntax error fix in uuid.api.php that doesn't belong in this issue. But I'm too lazy this Friday evening to revert and fix that. See http://drupalcode.org/project/uuid.git/commit/6a7b3a5
Comment #5
dixon_Re-opening this because we need a test for this. The vuuid condition on entity_uuid_load() has become vital to revision support for entity_dependency.module and deploy.module.
Comment #6
dixon_Pushed tests for this.