When the module is enabled and a content using this widget is saved there are many of those notices shown.

Notice: Array to string conversion in DrupalDefaultEntityController->cacheGet() (line 369 of /var/www/drupal/includes/entity.inc).

Comments

Andrey Inkin’s picture

Version: » 7.x-1.0

How do I recreate this problem? I tried it on my old install and on clean install with and without Entity API module.

cubeinspire’s picture

Php notices should be enabled. This depends on the php.ini, htaccess and drupal Settings.

cubeinspire’s picture

Entityapi has to be enabled too.

Andrey Inkin’s picture

I still don't get the error.
The line that triggers the error is the following:

<?php
  unset($entities[$entity->{$this->idKey}]);
?>

The only way this error can happen is when $this->idKey is an array. If for some reason $entity->{$this->idKey} is an array, then the error would say:

Warning: Illegal offset type

I've run a few tests, and for me $this->idKey always prints out a string ("tid" or "vid").

This variable is defined by hook_entity_info, and in this module it's taxonomy_entity_info (because the module does not define its own entities).

So, maybe have a look in taxonomy_entity_info(), what is $return['taxonomy_term']['entity keys']['id'] and $return['taxonomy_vocabulary']['entity keys']['id']. The values should be 'tid' and 'vid'.

kenyan’s picture

I have the same issue but do not have Taxonomy Orderable Tags autocomplete widget installed.
I didn't have this error showing up until I added an extra term reference field to my content type.
Notice: Array to string conversion in DrupalDefaultEntityController->cacheGet() (line 369 of /var/www/includes/entity.inc).

kenyan’s picture

Status: Active » Closed (duplicate)