Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293242

ImageItem::defaultStorageSettings should override display_default

$
0
0

Problem/Motivation

The value is always set to TRUE in \Drupal\file\Plugin\Field\FieldWidget\FileWidget::process (line 411) and causes invalid values from FormState::getValues after calling FormBuilder::buildForm if the form isn't submitted

Steps to reproduce

Create an entity form with an image widget
Call buildForm on the form builder for that form and inspect $form_state->getValue(['your_field_name', 0, 'display']) and note it will be FALSE despite the value being hard-coded to 1 in \Drupal\file\Plugin\Field\FieldWidget\FileWidget::process

Proposed resolution

Override ::defaultStorageSettings for ImageItem and set display_default to TRUE

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293242

Trending Articles