$wrapper->entity_reference_single->access('view') will return FALSE for the entity_test since there's no access callback defined, so entity_access() return NULL.

Patch will follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Status: Active » Needs review
FileSize
766 bytes

Patch explicitly checks for FALSE.

amitaibu’s picture

Found another place where we ignore the NULL value.

joshk’s picture

Any idea what needs to happen for this to get rolled in?

e0ipso’s picture

Status: Needs review » Reviewed & tested by the community

This works as expected.

  • fago committed a8688df on 7.x-1.x authored by Amitaibu
    Issue #2264079 by Amitaibu, fago: Fixed $wrapper->access() might be...
fago’s picture

Status: Reviewed & tested by the community » Fixed

Indeed, it should return TRUE if we do not know access. I fixed those return statements to return FALSE instead of NULL though, as it's documented that we return a boolean and this does not change existing behaviour then.

Committed, thanks.

Status: Fixed » Closed (fixed)

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

bdupls’s picture

I am running entity 7.1.6 and get this error
EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 737 of /Users/xxx/Sites/xxx/sites/all/modules/entity/includes/entity.wrapper.inc).
There seems to be other posts of this error so it seems that it is still a problem.
https://www.drupal.org/node/1519884
https://www.drupal.org/node/1925412
Is this caused by another module using entity? How do I problem solve?