🇳🇿New Zealand scott.whittaker
Patch based on #228 to fix the unlimited cardinality bug.
🇳🇿New Zealand scott.whittaker
The patch in #228 works for me, except that in my case I have a field with unlimited cardinality and when I edit an existing piece of content which has n items, it only shows n-1 items.
In WidgetBase.php I needed to change the $max from $field_state['items_count'] - 1 to $field_state['items_count'] in order to fix this bug:
// Determine the number of widgets to display.
switch ($cardinality) {
case FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED:
//$max = $field_state['items_count'] - 1;
$max = $field_state['items_count'];
$is_multiple = TRUE;
break;
🇳🇿New Zealand scott.whittaker
🇳🇿New Zealand scott.whittaker
#332 works for us too