Seemingly incompatible with other content types


#1 ief_node-access-error_2117637-01.patch644 bytesbendiy
bug1.PNG35.59 KBjetwodru
Members fund testing for the Drupal project. Drupal Association Learn more


bendiy’s picture

Status: Active » Needs review
644 bytes

I get this same error when using an Entity Reference field that references a node. I'm not sure if this is an Entity API problem or just how this module calls entity_access() with a node that hasn't been saved yet.

    $new_entity = inline_entity_form_create_entity($settings['entity_type'], $bundle);
    if (entity_access('create', $settings['entity_type'], $new_entity)) {
      $settings['create_bundles'][] = $bundle;

By not sending $new_entity to entity_access(), the errors go away:

    $new_entity = inline_entity_form_create_entity($settings['entity_type'], $bundle);
    if (entity_access('create', $settings['entity_type'])) {
      $settings['create_bundles'][] = $bundle;

See the attached patch that makes this change.

bojanz’s picture

Category: bug » support
Priority: Critical » Normal
Status: Needs review » Fixed

Entity API bug: #1780646: entity_access() fails to check node type specific create access.
IEF 1.3 has the proper code like the Entity API maintainer requested.

Status: Fixed » Closed (fixed)

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