[BUGFIX] Fix flash messages in TS object browser 09/44509/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Tue, 3 Nov 2015 14:33:09 +0000 (15:33 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 3 Nov 2015 20:37:25 +0000 (21:37 +0100)
* Remove unnecessary HTML encoding
* Remove HTML code in message
* Use correct queue

Resolves: #71282
Releases: master
Change-Id: I91b31622bfbc711ca659d79ec24463c77919afed
Reviewed-on: https://review.typo3.org/44509
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php

index 4a22580..f193bae 100644 (file)
@@ -252,23 +252,23 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
                     if ($POST['add_property']) {
                         $property = trim($POST['data'][$name]['name']);
                         if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) {
-                            $badPropertyMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noSpaces') . '<br />' . $lang->getLL('nothingUpdated'), $lang->getLL('badProperty'), FlashMessage::ERROR);
+                            $badPropertyMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noSpaces') . $lang->getLL('nothingUpdated'), $lang->getLL('badProperty'), FlashMessage::ERROR);
                             $this->addFlashMessage($badPropertyMessage);
                         } else {
                             $pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']);
-                            $propertyAddedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('propertyAdded'));
+                            $propertyAddedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('propertyAdded'));
                             $this->addFlashMessage($propertyAddedMessage);
                             $line .= LF . $pline;
                         }
                     } elseif ($POST['update_value']) {
                         $pline = $name . ' = ' . trim($POST['data'][$name]['value']);
-                        $updatedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('valueUpdated'));
+                        $updatedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('valueUpdated'));
                         $this->addFlashMessage($updatedMessage);
                         $line .= LF . $pline;
                     } elseif ($POST['clear_object']) {
                         if ($POST['data'][$name]['clearValue']) {
                             $pline = $name . ' >';
-                            $objectClearedMessage = GeneralUtility::makeInstance(FlashMessage::class, htmlspecialchars($pline), $lang->getLL('objectCleared'));
+                            $objectClearedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('objectCleared'));
                             $this->addFlashMessage($objectClearedMessage);
                             $line .= LF . $pline;
                         }
@@ -538,7 +538,7 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu
         /** @var $flashMessageService FlashMessageService */
         $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
         /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
-        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier('module.template.flashmessages');
         $defaultFlashMessageQueue->enqueue($flashMessage);
     }