diff --git a/src/Controller/LabelController.php b/src/Controller/LabelController.php index 8c0bcca0..90a6715b 100644 --- a/src/Controller/LabelController.php +++ b/src/Controller/LabelController.php @@ -147,7 +147,11 @@ class LabelController extends AbstractController ]); } - if ($form->get('update_profile')->isClicked() && $profile instanceof LabelProfile && $this->isGranted('edit', $profile)) { //@phpstan-ignore-line Phpstan does not recognize the isClicked method + //Check if the current profile should be updated + if ($form->has('update_profile') + && $form->get('update_profile')->isClicked() //@phpstan-ignore-line Phpstan does not recognize the isClicked method + && $profile instanceof LabelProfile + && $this->isGranted('edit', $profile)) { //Update the profile options $profile->setOptions($form_options); diff --git a/templates/label_system/dialog.html.twig b/templates/label_system/dialog.html.twig index 571eb264..037b549e 100644 --- a/templates/label_system/dialog.html.twig +++ b/templates/label_system/dialog.html.twig @@ -100,7 +100,9 @@ {% endif %} - {{ form_row(form.update_profile) }} + {% if form.update_profile is defined %} + {{ form_row(form.update_profile) }} + {% endif %}