Array to string conversion in DrupalDefaultEntityController->cacheGet() I have a content type that has a multi-value taxonomy field. When I create a new item and select several values, I am presented with the following error:


  Array to string conversion in DrupalDefaultEntityController->cacheGet() (line 369 of /path/to/drupal/installation/includes/entity.inc).


The values are saved and everything appears to be working, but having this error appear every time is a little distracting, especially for the office staff who are actually entering the data.

Why does this happen?
There's a very quick fix already, posted several weeks later after IntegrityFirst's answer.

See https://drupal.org/comment/7812787#comment-7812787 and this patch: https://drupal.org/files/drupal7.entity-system.1525176-104.patch (thanks to Molot for link to core bug thread).

It turns out that there is a function in Drupal core that supports multidimensional array diff causing this bug, but it's just not used there.

So, fix is to replace array_diff_assoc (not recursive) with drupal_array_diff_assoc_recursive (recursive, as it comes from its name) at line 364 of includes/entity.inc (see DrupalDefaultEntityController::cacheGet if line number differs or if patch fails).