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(), ];