From 4a5ac64a954351028b5ddbd5b67c80a1193e70dd Mon Sep 17 00:00:00 2001 From: "michael.danielczok" <michael@pcsg.de> Date: Mon, 2 Mar 2020 14:38:44 +0000 Subject: [PATCH] feat: Show brick title if an error "A Brick with the title already exists" occurred. quiqqer/package-bricks#117 (cherry picked from commit c25eeeb5307a3a855750bb1cac6fc5bc548b9490) --- locale.xml | 4 ++-- src/QUI/Bricks/Manager.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/locale.xml b/locale.xml index 8535bb1..229ddbb 100644 --- a/locale.xml +++ b/locale.xml @@ -1218,12 +1218,12 @@ Möchten Sie die Bausteine aus der Bausteinzone entfernen?</p>]]></de> </locale> <locale name="exception.brick.title.already.exists"> <de><![CDATA[ - Ein Baustein mit dem Titel existiert bereits. + Ein Baustein mit dem Titel "[brickTitle]" existiert bereits. Bausteine mit gleichem Titel erschweren die Übersichtlichkeit. Bitte wähle einen anderen Titel für diesen Baustein. ]]></de> <en><![CDATA[ - A Brick with the title already exists. + A Brick with the title "[brickTitle]" already exists. Bricks with the same title make it difficult to keep track of them. Please choose a different title for this Brick. ]]></en> diff --git a/src/QUI/Bricks/Manager.php b/src/QUI/Bricks/Manager.php index fc48686..6cea448 100644 --- a/src/QUI/Bricks/Manager.php +++ b/src/QUI/Bricks/Manager.php @@ -963,7 +963,8 @@ public function saveBrick($brickId, array $brickData) if (isset($result[0])) { throw new QUI\Exception([ 'quiqqer/bricks', - 'exception.brick.title.already.exists' + 'exception.brick.title.already.exists', + ['brickTitle' => $Brick->getAttribute('title')] ]); } -- GitLab