Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / TypedData / Plugin / DataType / ItemList.php
index 4f756dadf2540b9b15e9d4e37f5d353f1b02c67e..b84643fc4fc0c703f93bda477e7f27370a70a8e4 100644 (file)
@@ -87,7 +87,7 @@ class ItemList extends TypedData implements \IteratorAggregate, ListInterface {
       $strings[] = $item->getString();
     }
     // Remove any empty strings resulting from empty items.
-    return implode(', ', array_filter($strings, '\Drupal\Component\Utility\Unicode::strlen'));
+    return implode(', ', array_filter($strings, 'mb_strlen'));
   }
 
   /**
@@ -98,7 +98,10 @@ class ItemList extends TypedData implements \IteratorAggregate, ListInterface {
       throw new \InvalidArgumentException('Unable to get a value with a non-numeric delta in a list.');
     }
     // Automatically create the first item for computed fields.
+    // @deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0.
+    // Use \Drupal\Core\TypedData\ComputedItemListTrait instead.
     if ($index == 0 && !isset($this->list[0]) && $this->definition->isComputed()) {
+      @trigger_error('Automatically creating the first item for computed fields is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\TypedData\ComputedItemListTrait instead.', E_USER_DEPRECATED);
       $this->list[0] = $this->createItem(0);
     }
     return isset($this->list[$index]) ? $this->list[$index] : NULL;