From 20826daa186f44b554b46a892771f35af269a0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 27 Jun 2023 00:18:47 +0200 Subject: [PATCH] Show a notice flash if the content of labels is empty This implements the suggestion of issue #297 --- src/Controller/LabelController.php | 5 +++++ translations/messages.en.xlf | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/Controller/LabelController.php b/src/Controller/LabelController.php index 7d98019d..f5da187e 100644 --- a/src/Controller/LabelController.php +++ b/src/Controller/LabelController.php @@ -126,6 +126,11 @@ class LabelController extends AbstractController new FormError($this->translator->trans('label_generator.no_entities_found')) ); } + + //When the profile lines are empty, show a notice flash + if (trim($form_options->getLines()) === '') { + $this->addFlash('notice', 'label_generator.no_lines_given'); + } } return $this->render('label_system/dialog.html.twig', [ diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 820c74b4..11358786 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -11463,5 +11463,11 @@ Element 3 Auto (decide based on system settings) + + + label_generator.no_lines_given + No text content given! The labels will remain empty. + +