Skip to content

Commit

Permalink
Fix "Can only flip string and integer values" via farm_crop_plan_form…
Browse files Browse the repository at this point in the history
…_quick_form_planting_alter #32
  • Loading branch information
mstenta committed Mar 18, 2024
1 parent b0137ff commit 384a986
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion farm_crop_plan.module
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,12 @@ function farm_crop_plan_form_plan_record_crop_planting_edit_form_alter(&$form, F
function farm_crop_plan_form_quick_form_planting_alter(&$form, FormStateInterface $form_state, $form_id) {

// Alter the planting quick form, if a crop plan was specified.
$plan_id = \Drupal::request()->query->get('plan');
if (empty($plan_id)) {
return;
}
/** @var \Drupal\plan\Entity\PlanInterface $plan */
$plan = \Drupal::entityTypeManager()->getStorage('plan')->load(\Drupal::request()->query->get('plan'));
$plan = \Drupal::entityTypeManager()->getStorage('plan')->load($plan_id);
if (is_null($plan) || $plan->bundle() !== 'crop') {
return;
}
Expand Down

0 comments on commit 384a986

Please sign in to comment.