Skip to content

Commit

Permalink
Modified widget on change request : tv4g1-issue1414-uo__unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Malladi committed Nov 7, 2023
1 parent c6f5e2c commit 9c5c525
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,18 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen

return $elements;
}

/**
* {@inheritDoc}
*/
public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
// Remove any empty values that don't have a unit type
foreach ($values as $delta => $item) {
if ($item['unittype_id'] == '') {
unset($values[$delta]);
}
}
return $values;
}

}

0 comments on commit 9c5c525

Please sign in to comment.