From 8e4248c2356de522ad0441f16811bcd676c399b6 Mon Sep 17 00:00:00 2001 From: tuutti Date: Mon, 6 Nov 2023 09:10:47 +0200 Subject: [PATCH] UHF-9266: Make sure menu title is a required field --- src/Entity/Form/MenuLinkFormTrait.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Entity/Form/MenuLinkFormTrait.php b/src/Entity/Form/MenuLinkFormTrait.php index 4344e9ee..3f63a735 100644 --- a/src/Entity/Form/MenuLinkFormTrait.php +++ b/src/Entity/Form/MenuLinkFormTrait.php @@ -146,6 +146,11 @@ protected function attachMenuLinkForm(array $form, FormStateInterface $formState $form['menu']['link']['title'] = [ '#type' => 'textfield', '#title' => $this->t('Menu link title'), + '#states' => [ + 'required' => [ + 'input[name="menu[enabled]"]' => ['checked' => TRUE], + ], + ], '#default_value' => $menuLink->label(), ];