Skip to content

Commit

Permalink
Fix Exception thrown on farmOS 3.1 due to harvest_days field not bein…
Browse files Browse the repository at this point in the history
…g available on plant types #33
  • Loading branch information
wotnak authored and mstenta committed Mar 27, 2024
1 parent efc9875 commit ac63da2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Form/CropPlanAddPlantingForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function plantingDefaultValues($plant = NULL) {
}

// Populate harvest_days from the plant_type.
if ($plant_type->get('harvest_days')->value) {
if ($plant_type->hasField('harvest_days') && $plant_type->get('harvest_days')->value) {
$values['harvest_days'] = $plant_type->get('harvest_days')->value;
}
}
Expand Down

0 comments on commit ac63da2

Please sign in to comment.