Skip to content
Snippets Groups Projects
Commit bfcba532 authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment