diff --git a/typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php b/typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php index 4445435f7bb1f4671bb61e66267ec35f4b207b5d..1d6d661d01ea281992dacc75c2106f38d310cc5e 100644 --- a/typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php +++ b/typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php @@ -177,23 +177,22 @@ class DownloadController extends AbstractController { * already. This method should only be called if we are sure that there is * an update. * - * @return void + * @return string */ protected function updateExtensionAction() { - $hasErrors = FALSE; - $errorMessage = ''; - $extensionKey = $this->request->getArgument('extension'); $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionKey); try { $this->managementService->downloadMainExtension($highestTerVersionExtension); + $this->addFlashMessage( + htmlspecialchars($this->translate('extensionList.updateFlashMessage.body', array($extensionKey))), + $this->translate('extensionList.updateFlashMessage.title') + ); } catch (\Exception $e) { - $hasErrors = TRUE; - $errorMessage = $e->getMessage(); + $this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR); } - $this->view->assign('extension', $highestTerVersionExtension) - ->assign('hasErrors', $hasErrors) - ->assign('errorMessage', $errorMessage); + + return ''; } /** diff --git a/typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf b/typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf index 42b5a007abf0ea5b90aaf17f4c05ca79529af3b5..6bf4bd0f9e11c91bde1c3c6059c38ea0d2842bab 100644 --- a/typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf +++ b/typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf @@ -213,9 +213,12 @@ <trans-unit id="extensionList.updateFlashMessage.title" xml:space="preserve"> <source>Extension Update</source> </trans-unit> - <trans-unit id="extensionList.updateFlashMessage.message" xml:space="preserve"> + <trans-unit id="extensionList.updateFlashMessage.message" xml:space="preserve" deprecated="Unused since CMS 6.2"> <source>{0} updated!</source> </trans-unit> + <trans-unit id="extensionList.updateFlashMessage.body" xml:space="preserve"> + <source>%s was updated!</source> + </trans-unit> <trans-unit id="extensionList.removalConfirmation.question" xml:space="preserve"> <source>Are you sure you want to remove the extension?</source> </trans-unit> diff --git a/typo3/sysext/extensionmanager/Resources/Private/Templates/Download/UpdateExtension.json b/typo3/sysext/extensionmanager/Resources/Private/Templates/Download/UpdateExtension.json deleted file mode 100644 index 4195df6f07f4cdfea42113279d33775d6412c41c..0000000000000000000000000000000000000000 --- a/typo3/sysext/extensionmanager/Resources/Private/Templates/Download/UpdateExtension.json +++ /dev/null @@ -1,5 +0,0 @@ -{namespace em=TYPO3\CMS\Extensionmanager\ViewHelpers} -<em:format.jsonEncode additionalAttributes="{extension:extension.extensionKey, -errorMessage:errorMessage, -hasErrors:hasErrors -}" /> \ No newline at end of file diff --git a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js index 399b1be7195046070d4826ec83fc4ba10fb5e083..df90a015e68d5f01203acc56cf2387565525b8d1 100644 --- a/typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js +++ b/typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js @@ -216,36 +216,8 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) { beforeSend: function() { $extManager.mask(); }, - success: function(data) { - if (data.hasErrors) { - top.TYPO3.Flashmessage.display( - top.TYPO3.Severity.error, - TYPO3.lang['downloadExtension.updateExtension.error'], - data.errorMessage, - 15 - ); - $extManager.unmask(); - } else { - top.TYPO3.Flashmessage.display( - top.TYPO3.Severity.info, - TYPO3.lang['extensionList.updateFlashMessage.title'], - TYPO3.lang['extensionList.updateFlashMessage.message'].replace(/\{0\}/g, data.extension), - 15 - ); - location.reload(); - } - }, - error: function(jqXHR, textStatus, errorThrown) { - // Create an error message with diagnosis info. - var errorMessage = textStatus + '(' + errorThrown + '): ' + jqXHR.responseText; - - top.TYPO3.Flashmessage.display( - top.TYPO3.Severity.error, - TYPO3.lang['downloadExtension.updateExtension.error'], - errorMessage, - 15 - ); - $extManager.unmask(); + complete: function() { + location.reload(); } }); top.TYPO3.Modal.dismiss();