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.

Comments

timaholt’s picture

Assigned: timaholt » Unassigned
Status: Active » Needs review
timaholt’s picture

StatusFileSize
new1.38 KB

Updating patch to avoid php notices when a revision uuid is not defined for an entity.

timaholt’s picture

StatusFileSize
new1.47 KB

One more time, last patch didn't fix the notice, this one does.

timaholt’s picture

Issue summary: View changes

fixing typo 'of'

dixon_’s picture

Issue summary: View changes
Status: Needs review » Fixed

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

dixon_’s picture

Status: Fixed » Active
Issue tags: +Needs tests

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.

dixon_’s picture

Status: Active » Fixed

Pushed tests for this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.