Problem/Motivation
It is not possible to select a different value when using a select widget with required fields in the configuration.
Steps to reproduce
- Add a plugin_reference type field to the entity with settings:
...
->setRequired(TRUE)
->setDisplayOptions('form', [
'type' => 'plugin_reference_select',
'settings' => ['provider_grouping' => FALSE],
])
->setDisplayOptions('view', ['type' => 'plugin_reference_label']);
...
The plugin configuration form must have the required fields.
- Go to the entity editing form
- Do not fill in the required form fields
- Try changing the selected value several times
- You will notice that the configuration form does not change
This will be very noticeable when plugins have different fields.
This happens because the form does not pass validation.
Proposed resolution
Validate only when trigger is a button
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3473082-2-validate-widget-fix.patch | 881 bytes | lukasss |
Issue fork pluginreference-3473082
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lukasss commentedComment #3
lukasss commentedComment #4
lukasss commentedComment #5
lukasss commentedComment #9
jeroentMerged to 3.0.x. Thanks!