Commit f4eec7cc authored by Hawkeye Tenderwolf's avatar Hawkeye Tenderwolf Committed by Marcos Cano
Browse files

Issue #3268777 by hawkeye.twolf, marcoscano: Support widgets with non-numeric form keys

parent 31a84808
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ function sam_field_widget_multivalue_form_alter(array &$elements, FormStateInter
    // We only have something to simplify if the maximum cardinality hasn't
    // already been reached.
    $should_simplify = FALSE;
    foreach (Element::children($elements) as $delta) {
    $deltas = array_filter(Element::children($elements), 'is_numeric');
    foreach ($deltas as $delta) {
      $item = $items->get($delta);
      // We trust the field telling us it's empty or not. Also, when the field
      // has 0 values, we leave the first empty element visible, so we only