I also found an issue about multivalued widgets. When $multivalue = TRUE but $element['#theme'] == 'field_multiple_value_form', the element is actually just a wrapper and the only child will be handled separately anyway.
See Drupal\Core\Entity\Display\EntityFormDisplayInterface:
* // For 'single-value' widgets:
* '#theme' => 'field_multiple_value_form',
* '#cardinality' => The field cardinality,
* '#cardinality_multiple' => TRUE if the field can contain multiple
* items, FALSE otherwise.
I also found out that for datetime widget, the '#field_parents' key is set as $element['#field_parents'] instead of $element['value']['#field_parents']
Comments
Comment #2
tavib47 commentedComment #3
tavib47 commentedI also found an issue about multivalued widgets. When
$multivalue = TRUEbut$element['#theme'] == 'field_multiple_value_form', the element is actually just a wrapper and the only child will be handled separately anyway.See
Drupal\Core\Entity\Display\EntityFormDisplayInterface:Comment #4
tavib47 commentedComment #6
tavib47 commentedI also found out that for
datetimewidget, the'#field_parents'key is set as$element['#field_parents']instead of$element['value']['#field_parents']Comment #7
nickdickinsonwildeThanks for the reports - and patience, haven't been the most active with this module lately.
Best to fix one issue per umh issue; so I'm just fixing the first report in this commit.
That said, see core issue #3004738: Multiple Value Field Doesn't Render Attributes re the error with field_multiple_value_form, and changes in #3004850: Improve handling of multiple value forms for improved handling here.
Comment #9
nickdickinsonwildeComment #10
nickdickinsonwilde