[BUGFIX] Taskcenter: Removed call to deprecated method render() 37/45537/2
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 27 Dec 2015 12:06:42 +0000 (13:06 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Thu, 31 Dec 2015 17:58:17 +0000 (18:58 +0100)
Calls of FlashMessage->render() are replaced with appropriate code.

Resolves: #72447
Releases: master, 7.6
Change-Id: I2163fe8fea9b654034fc5a45d05a21ae8c99472c
Reviewed-on: https://review.typo3.org/45537
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/taskcenter/Resources/Public/Css/styles.css

index 5115de6..9a56871 100644 (file)
@@ -210,8 +210,16 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
         if (!empty($actionList)) {
             $content .= $this->taskObject->renderListMenu($actionList);
         } else {
-            $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $this->getLanguageService()->getLL('action_not-found-description', true), $this->getLanguageService()->getLL('action_not-found'), \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
-            $content .= $flashMessage->render();
+            $flashMessage = GeneralUtility::makeInstance(
+                \TYPO3\CMS\Core\Messaging\FlashMessage::class,
+                $this->getLanguageService()->getLL('action_not-found-description', true),
+                $this->getLanguageService()->getLL('action_not-found'),
+                \TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
+            /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+            $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
+            /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+            $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+            $defaultFlashMessageQueue->enqueue($flashMessage);
         }
         // Admin users can create a new action
         if ($this->getBackendUser()->isAdmin()) {
index 42956b0..5edbf63 100644 (file)
@@ -187,6 +187,7 @@ class TaskModuleController extends BaseScriptClass
         }
         // Render the task
         $actionContent = '';
+        $flashMessage = null;
         list($extKey, $taskClass) = explode('.', $chosenTask, 2);
         if (class_exists($taskClass)) {
             $taskInstance = GeneralUtility::makeInstance($taskClass, $this);
@@ -201,7 +202,6 @@ class TaskModuleController extends BaseScriptClass
                         $this->getLanguageService()->getLL('error_header'),
                         FlashMessage::ERROR
                     );
-                    $actionContent .= $flashMessage->render();
                 }
             } else {
                 // Error if the task is not an instance of \TYPO3\CMS\Taskcenter\TaskInterface
@@ -211,7 +211,6 @@ class TaskModuleController extends BaseScriptClass
                     $this->getLanguageService()->getLL('error_header'),
                     FlashMessage::ERROR
                 );
-                $actionContent .= $flashMessage->render();
             }
         } else {
             $flashMessage = GeneralUtility::makeInstance(
@@ -220,8 +219,16 @@ class TaskModuleController extends BaseScriptClass
                 $this->getLanguageService()->sL('LLL:EXT:taskcenter/Resources/Private/Language/locallang_mod.xlf:mlang_tabs_tab'),
                 FlashMessage::INFO
             );
-            $actionContent .= $flashMessage->render();
         }
+
+        if ($flashMessage) {
+            /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+            $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
+            /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+            $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+            $defaultFlashMessageQueue->enqueue($flashMessage);
+        }
+
         $content = '<div id="taskcenter-main">
                                                <div id="taskcenter-menu">' . $this->indexAction() . '</div>
                                                <div id="taskcenter-item" class="' . htmlspecialchars(($extKey . '-' . $taskClass)) . '">' . $actionContent . '
@@ -404,7 +411,11 @@ class TaskModuleController extends BaseScriptClass
                 '',
                 FlashMessage::INFO
             );
-            $this->content .= $flashMessage->render();
+            /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
+            $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
+            /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
+            $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
+            $defaultFlashMessageQueue->enqueue($flashMessage);
         }
         return $content;
     }
index e13434b..062f37c 100644 (file)
@@ -36,14 +36,15 @@ body#ext-taskcenter-task-index-php h3 {
 
 #taskcenter-main #taskcenter-menu {
        width: 250px;
+       float: left;
 }
 
 #taskcenter-main #taskcenter-item {
        position: absolute;
        margin-left: 270px;
        margin-right: 20px;
-       top: 90px;
        min-width: 300px;
+       float: right;
 }
 
 /* ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- */