Fix planting quick form creating empty quantities #737
This commit is contained in:
parent
6657a88254
commit
e41a34858c
|
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix planting quick form creating empty quantities #737](https://github.com/farmOS/farmOS/pull/737)
|
||||
|
||||
## [2.2.1] 2023-10-09
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -562,14 +562,14 @@ class Planting extends QuickFormBase {
|
|||
* @param array $values
|
||||
* Quantity field values from the form.
|
||||
*
|
||||
* @return array
|
||||
* Returns an array to pass into createLog() or createQuantity().
|
||||
* @return array|null
|
||||
* Returns an array for createQuantity() or NULL if no quantity value.
|
||||
*/
|
||||
protected function prepareQuantity(array $values) {
|
||||
|
||||
// If there is no value, return an empty array.
|
||||
if (empty($values['value'])) {
|
||||
return [];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// If units is specified, then we need to convert it to units_id, which
|
||||
|
|
Loading…
Reference in New Issue