When using the deploy_revisions branch of deploy, the _uuid_services_entity_access function in uuid_services does a check to ensure that the user has permissions to perform the operation on the entity. If you are deploying a revision of a field collection, this access callback returns false in isolation (since the field collection entity is created separately from the parent node when using deploy). This small patch fixes this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joseph.olstad’s picture

Issue summary: View changes

RTBC ++

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

I know this one will pass the bot tests again on retest because I recently tested it myself.

Marking this as RTBC

we're using uuid revision a7bf2db with this patch (and several others)

We've been using this patch for 8 months at least and most recently on the newer revision of uuid. Lets commit.

skwashd’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Isn't the result of this that there is no access check performed when deploying field collections?

joseph.olstad’s picture

Yes skwashd it looks that way, I will notify colleague about this and follow up

joseph.olstad’s picture

The description explains it, see issue explanation above

skwashd’s picture

Status: Postponed (maintainer needs more info) » Needs work

I like to avoid module specific hacks in UUID.

I'd like to propose a different approach. In uuid_services implement hook_entity_info_alter() to change the access callback for field_collection_item. The new callback checks if the parent entity is empty and if it is it returns TRUE otherwise it calls field_collection_item_access().

skwashd’s picture

Adding a check for the presence $entity->uuid_services would ensure that this is firing when the entity is coming from UUID Services.

Boobaa’s picture

As the contrib-related parts have been stripped off from UUID to UUID Extras (well, only partially), I had to roll a patch against UUID Extras to be able to actually utilize the Deploy module for pushing nodes with field_collections. So this work from #1817956-42: Field collection support might be needed for additional work on this issue. TL;DR: Neither Deploy nor Field Collection themselves are affected, but both UUID and UUID Extras needs patching. Some additional work might be needed for the revision- and access-related parts.