[!!!][TASK] Remove flashmessage_compatibility.js from core 83/46683/3
authorFrank Naegler <frank.naegler@typo3.org>
Mon, 15 Feb 2016 20:04:05 +0000 (21:04 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 16 Feb 2016 09:44:59 +0000 (10:44 +0100)
The flashmessage_compatibility.js is deprecated since TYPO3 7 and is now
removed from core.

The deprecated flashmessage_compatibility.js is loaded at first and takes
place in ``TYPO3.Severity``. The singleton check of
``TYPO3/CMS/Backend/Severity`` detects that ``TYPO3.Severity`` is already
existing and stops the execution. In fact, ``TYPO3/CMS/Backend/Severity``
is never used.

Resolves: #73445
Releases: master
Change-Id: I87982cd9b6880448d430c77bd16ddfbb4bdc7991
Reviewed-on: https://review.typo3.org/46683
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js [deleted file]
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-73445-RemoveFlashmessage_compatibilityjsFromCore.rst [new file with mode: 0644]

diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js b/typo3/sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js
deleted file mode 100644 (file)
index b5dd6ab..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Javascript compatibility file for a breaking change to the
- * flashmessage javascript object
- * @deprecated since TYPO3 CMS 7, this file will be removed in TYPO3 CMS 9
- */
-
-// map old Severity object to the new one
-var Severity = {
-       notice: -2,
-       // @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 9, use info instead of information
-       information: -1,
-       info: -1,
-       ok: 0,
-       warning: 1,
-       error: 2
-};
-if (!TYPO3.Severity) {
-       TYPO3.Severity = Severity;
-}
-if (!top.TYPO3.Severity) {
-       top.TYPO3.Severity = Severity;
-}
-
-// map old Flashmessage API to the new one
-if (!TYPO3.Flashmessage) {
-       TYPO3.Flashmessage = {};
-       TYPO3.Flashmessage.display = function(severity, title, message, duration) {
-               if (console !== undefined) {
-                       console.log('TYPO3.Flashmessage.display is deprecated and will be removed with CMS 9, please use top.TYPO3.Notification.*');
-               }
-               // never use showMessage, this only allowed at this place for
-               // compatibility to the old flashMessage api! showMessage is declared as private!
-               top.TYPO3.Notification.showMessage(title, message, severity, duration);
-       }
-}
index 30aef24..b3e2014 100644 (file)
@@ -1314,10 +1314,6 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
         if (empty($filterNamespaces)) {
             $filterNamespaces = array('TYPO3');
         }
-        // @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 9
-        // add compatibility mapping for the old flashmessage API
-        $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath .
-            ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/flashmessage_compatibility.js'));
 
         // Add language labels for ExtDirect
         if (TYPO3_MODE === 'FE') {
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-73445-RemoveFlashmessage_compatibilityjsFromCore.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-73445-RemoveFlashmessage_compatibilityjsFromCore.rst
new file mode 100644 (file)
index 0000000..2ef3535
--- /dev/null
@@ -0,0 +1,20 @@
+=================================================================
+Breaking: #73445 - Remove flashmessage_compatibility.js from core
+=================================================================
+
+Description
+===========
+
+The ``flashmessage_compatibility.js`` has been removed from core.
+
+
+Impact
+======
+
+Extensions which make use of :js:`TYPO3.Flashmessage` JavaScript function will not work anymore.
+
+
+Migration
+=========
+
+Use :js:`top.TYPO3.Notification.*` to create flash messages within JavaScript for the TYPO3 backend.