diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/TagController.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index c228c27a..f7b78f5d 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -151,7 +151,10 @@ class TagController extends Controller | |||
151 | $form = $this->createForm(RenameTagType::class, new Tag()); | 151 | $form = $this->createForm(RenameTagType::class, new Tag()); |
152 | $form->handleRequest($request); | 152 | $form->handleRequest($request); |
153 | 153 | ||
154 | if ($form->isSubmitted() && $form->isValid()) { | 154 | if ($form->isSubmitted() |
155 | && $form->isValid() | ||
156 | && $form->get('label')->getData() !== $tag->getLabel() | ||
157 | ) { | ||
155 | $newTagLabel = $form->get('label')->getData(); | 158 | $newTagLabel = $form->get('label')->getData(); |
156 | $newTag = new Tag(); | 159 | $newTag = new Tag(); |
157 | $newTag->setLabel($newTagLabel); | 160 | $newTag->setLabel($newTagLabel); |
@@ -171,12 +174,12 @@ class TagController extends Controller | |||
171 | 174 | ||
172 | $em = $this->getDoctrine()->getManager(); | 175 | $em = $this->getDoctrine()->getManager(); |
173 | $em->flush(); | 176 | $em->flush(); |
174 | } | ||
175 | 177 | ||
176 | $this->get('session')->getFlashBag()->add( | 178 | $this->get('session')->getFlashBag()->add( |
177 | 'notice', | 179 | 'notice', |
178 | 'flashes.tag.notice.tag_renamed' | 180 | 'flashes.tag.notice.tag_renamed' |
179 | ); | 181 | ); |
182 | } | ||
180 | 183 | ||
181 | $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true); | 184 | $redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'), '', true); |
182 | 185 | ||