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

OptionsWidgetBase options are stale

$
0
0

Problem/Motivation

\Drupal\Core\Field\Plugin\Field\FieldWidget\OptionsWidgetBase::getOptions() computes the options for the widgets extending from that class and as it offers an alter hook it makes it possible to have dynamic options, which might change during a form rebuild. But as the options are set the hook will not be called anymore and not allow changing the options.

Proposed resolution

Don't cache the options or find a way to reset them before the form is being rebuild.

Remaining tasks

Add tests
Review
Commit

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 300359

Latest Images

Trending Articles