EntityAPIController->invoke() is trying to access $this->nameKey property, which is not defined by construct():

<?php
      elseif ($hook == 'update' && $id = $entity->{$this->nameKey}) {
        if ($entity->original->{$this->bundleKey} != $entity->{$this->bundleKey}) {
          field_attach_rename_bundle($type, $entity->original->{$this->bundleKey}, $entity->{$this->bundleKey});
        }
      }
?>

I suppose this code from EntityAPIControllerExportable:

<?php $this->nameKey = isset($this->entityInfo['entity keys']['name']) ? $this->entityInfo['entity keys']['name'] : $this->idKey;?>

should be moved to EntityAPIController constructor.

CommentFileSizeAuthor
#1 entity_name_key.patch943 bytesfago
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Status: Active » Needs review
FileSize
943 bytes

true. I doesn't look like the id is used at all, so let's remove it.

fago’s picture

Status: Needs review » Fixed

and committed.

Status: Fixed » Closed (fixed)

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