Issue #1470236 by iamEAP, mstrelan, poker10, divesh.kumar: Array flip error when a taxonomy term field has a NULL value
parent
7c73718bac
commit
f1199f88e5
|
@ -1684,7 +1684,7 @@ function taxonomy_field_formatter_prepare_view($entity_type, $entities, $field,
|
|||
}
|
||||
}
|
||||
if ($tids) {
|
||||
$terms = taxonomy_term_load_multiple($tids);
|
||||
$terms = taxonomy_term_load_multiple(array_filter($tids));
|
||||
|
||||
// Iterate through the fieldable entities again to attach the loaded term data.
|
||||
foreach ($entities as $id => $entity) {
|
||||
|
|
|
@ -1698,6 +1698,13 @@ class TaxonomyTermFieldTestCase extends TaxonomyWebTestCase {
|
|||
$entity = field_test_entity_test_load($entity->ftid);
|
||||
field_test_entity_save($entity);
|
||||
$this->pass('Empty term ID does not trigger autocreate.');
|
||||
|
||||
// Try also NULL value.
|
||||
$entity->{$this->field_name}[$langcode][0]['tid'] = NULL;
|
||||
field_test_entity_save($entity);
|
||||
$this->pass('NULL term ID does not trigger autocreate.');
|
||||
field_attach_prepare_view('test_entity', array($entity->ftid => $entity), 'full');
|
||||
$this->pass('NULL term ID prepared to display.');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue