Skip to content

Commit

Permalink
Merge pull request #143 from City-of-Helsinki/UHF-9266
Browse files Browse the repository at this point in the history
UHF-9266: Make sure menu title is a required field
  • Loading branch information
tuutti authored Nov 6, 2023
2 parents caedd5a + 8e4248c commit cd300f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Entity/Form/MenuLinkFormTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
];

Expand Down

0 comments on commit cd300f7

Please sign in to comment.