Currently the entity object has already been modified heavily (timestamps stripped, entity id and revision id removed) once it gets passed to hook_uuid_entities_features_export_entity_alter().
This makes it either impossible or at least difficult to retrieve these original properties.

The appended patch passes a new, third $context argument that contains a shallow clone of the entity object. I've also added entity_info for convenience.

Note: Another approach that would be less versatile but also more light-weight would include adding only the removed properties to the $context array.

CommentFileSizeAuthor
uuid-export-pass-original-entity.patch1.21 KBciss
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ciss’s picture

Status: Active » Needs review
ciss’s picture

Status: Needs review » Closed (won't fix)

Since I'm guessing that this will never happen I am closing the issue and describing our workaround instead:

We had two use cases:

  1. Keep the revision_id / vuuid intact: We implemented hook_entity_uuid_load() and stored revision ids / vuuids in custom properties on the entity objects. We would add them back later in hook_uuid_entities_features_export_entity_alter().
  2. Get the unmodified entity: This can be achieved either via entity_load() or entity_revision_load().