Commit bfcba532 authored by alexpott's avatar alexpott

Issue #2550225 by swentel, yched, Wim Leers, aspilicious:...

Issue #2550225 by swentel, yched, Wim Leers, aspilicious: quickedit_test_entity_view_alter() creates a non compliant field render array
parent 36b936fe
......@@ -1480,7 +1480,7 @@ function template_preprocess_field(&$variables, $hook) {
// readers.
$variables['label'] = $element['#title'];
$variables['multiple'] = $element['#items']->getFieldDefinition()->getFieldStorageDefinition()->isMultiple();
$variables['multiple'] = $element['#is_multiple'];
static $default_attributes;
if (!isset($default_attributes)) {
......@@ -1488,7 +1488,7 @@ function template_preprocess_field(&$variables, $hook) {
}
// Merge attributes when a single-value field has a hidden label.
if ($element['#label_display'] == 'hidden' && !$variables['multiple'] && is_object($element['#items'][0])) {
if ($element['#label_display'] == 'hidden' && !$variables['multiple']) {
$variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], (array) $element['#items'][0]->_attributes);
}
......
......@@ -99,6 +99,7 @@ public function view(FieldItemListInterface $items) {
'#object' => $entity,
'#items' => $items,
'#formatter' => $this->getPluginId(),
'#is_multiple' => $this->fieldDefinition->getFieldStorageDefinition()->isMultiple(),
);
$elements = array_merge($info, $elements);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment