diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ab8beb8..0e5cbc3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- Fix empty dropdown value (-1) on form submission - Fix text area fields size and alignment - Optimize container loading when there are a large number of entities diff --git a/inc/destinationfield.class.php b/inc/destinationfield.class.php index 831f2081..3cc553cc 100644 --- a/inc/destinationfield.class.php +++ b/inc/destinationfield.class.php @@ -135,7 +135,8 @@ public function applyConfiguratedValueToInputUsingAnswers( $input[sprintf('itemtype_%s', $field_name)] = $answer->getRawAnswer()['itemtype']; $input[sprintf('items_id_%s', $field_name)] = $answer->getRawAnswer()['items_id']; } elseif ($field->fields['type'] == 'dropdown') { - $input[$field_name] = $answer->getRawAnswer()['items_id']; + $raw_id = (int) $answer->getRawAnswer()['items_id']; + $input[$field_name] = ($raw_id > 0) ? $raw_id : null; } else { $input[$field_name] = $value ?? $answer->getRawAnswer(); }