Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AndyF’s picture

amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

amitaibu’s picture

Status: Fixed » Needs work

Sorry, had to revert this patch, as upon clear cache in entityreference_field_load() no behaviors are loaded, thus $handler->load() isn't invoked.

DamienMcKenna’s picture

That suggests another problem elsewhere - &drupal_static() is the recommended usage:

https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drup...

Jorrit’s picture

The bug is caused by this line:

$object_cache[$field['field_name']] = array();

it should read:

$object_cache[$identifier] = array();

(except, this line already exists so the original line can be removed altogether)

Because of this difference, sometimes empty arrays are added to the $object_cache leading to bad results.

The attached patch fixes this problem.

Jorrit’s picture

Status: Needs work » Needs review