Skip to content

Commit

Permalink
Reuse $plant_id variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstenta committed Jun 11, 2024
1 parent 1a36df3 commit e37c34f
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 @@ -129,7 +129,7 @@ public function buildForm(array $form, FormStateInterface $form_state, PlanInter
// form value.
$plant_id = $this->request->get('plant');
if ($plant_id) {
$plant = $this->entityTypeManager->getStorage('asset')->load($this->request->get('plant'));
$plant = $this->entityTypeManager->getStorage('asset')->load($plant_id);
if (!empty($plant) && $plant->bundle() == 'plant') {
$form['plant']['#default_value'] = $plant;
$form_state->setValue('plant', $plant_id);
Expand Down

0 comments on commit e37c34f

Please sign in to comment.