commit 09691632afbccfe4cb056f4bc17cd8fdff6fee9c Author: fago Date: Mon Dec 31 15:58:57 2012 +0100 More minor improvements. diff --git a/core/lib/Drupal/Core/Entity/Field/Type/Field.php b/core/lib/Drupal/Core/Entity/Field/Type/Field.php index 547c190..03d17e4 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/Field.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/Field.php @@ -74,7 +74,10 @@ public function getValue() { * An array of values of the field items. */ public function setValue($values) { - if (isset($values) && $values !== array()) { + if (!isset($values) || $values === array()) { + $this->list = $values; + } + else { // Support passing in only the value of the first item. if (!is_array($values) || !is_numeric(current(array_keys($values)))) { $values = array(0 => $values); @@ -98,12 +101,6 @@ public function setValue($values) { } } } - elseif (is_array($values) && empty($values)) { - $this->list = array(); - } - else { - $this->list = NULL; - } } /** diff --git a/core/lib/Drupal/Core/TypedData/ListInterface.php b/core/lib/Drupal/Core/TypedData/ListInterface.php index 72d05d5..f6f906b 100644 --- a/core/lib/Drupal/Core/TypedData/ListInterface.php +++ b/core/lib/Drupal/Core/TypedData/ListInterface.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\Core\TypedData\ListInterface. + * Contains \Drupal\Core\TypedData\ListInterface. */ namespace Drupal\Core\TypedData; diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php index c131aaf..4c4e9e6 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationControllerNG.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\translation_entity\EntityTranslationControllerNG. + * Contains \Drupal\translation_entity\EntityTranslationControllerNG. */ namespace Drupal\translation_entity;