[!!!][TASK] Remove deprecated `TYPO3/CMS/Backend/Storage` 49/59349/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 6 Jan 2019 14:26:08 +0000 (15:26 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 6 Jan 2019 18:44:45 +0000 (19:44 +0100)
Resolves: #87340
Related: #87193
Releases: master
Change-Id: I2f41008e0e3827c52f5d5351a53898bd22f3748d
Reviewed-on: https://review.typo3.org/59349
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/UserSettingsController.php
typo3/sysext/backend/Resources/Private/TypeScript/Storage.ts [deleted file]
typo3/sysext/backend/Resources/Public/JavaScript/Storage.js [deleted file]
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst

index c82ab8b..1d98dcd 100644 (file)
@@ -156,7 +156,6 @@ class BackendController
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ContextMenu');
 
         // load the storage API and fill the UC into the PersistentStorage, so no additional AJAX call is needed
-        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage');
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Storage/Persistent', 'function(PersistentStorage) {
             PersistentStorage.load(' . json_encode($this->getBackendUser()->uc) . ');
         }');
index 63e0b27..a121faf 100644 (file)
@@ -23,7 +23,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * A wrapper class to call BE_USER->uc
- * used for AJAX and TYPO3.Storage JS object
+ * used for AJAX and Storage/Persistent JS object
  * @internal This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
  */
 class UserSettingsController
diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/Storage.ts b/typo3/sysext/backend/Resources/Private/TypeScript/Storage.ts
deleted file mode 100644 (file)
index 999949f..0000000
+++ /dev/null
@@ -1,126 +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!
- */
-
-import Client = require('./Storage/Client');
-import Persistent = require('./Storage/Persistent');
-
-/**
- * Module: TYPO3/CMS/Backend/Storage
- * Adds a public API for the browsers' localStorage called
- * TYPO3.Storage.Client and the Backend Users "uc",
- * available via TYPO3.Storage.Persistent
- * @exports TYPO3/CMS/Backend/Storage
- * @deprecated
- */
-class Storage {
-  public Client: any;
-  public Persistent: any;
-
-  constructor() {
-    this.Client = {
-      clear: (): any => {
-        this.logDeprecated('Client', 'clear');
-        Client.clear();
-      },
-      get: (key: string): any => {
-        this.logDeprecated('Client', 'get');
-        return Client.get(key);
-      },
-      isset: (key: string): any => {
-        this.logDeprecated('Client', 'isset');
-        return Client.isset(key);
-      },
-      set: (key: string, value: string): any => {
-        this.logDeprecated('Client', 'set');
-        return Client.set(key, value);
-      },
-      unset: (key: string): any => {
-        this.logDeprecated('Client', 'unset');
-        return Client.unset(key);
-      },
-    };
-    this.Persistent = {
-      addToList: (key: string, value: string): any => {
-        this.logDeprecated('Persistent', 'addToList');
-        return Persistent.addToList(key, value);
-      },
-      clear: (): any => {
-        this.logDeprecated('Persistent', 'clear');
-        Persistent.clear();
-      },
-      get: (key: string): any => {
-        this.logDeprecated('Persistent', 'get');
-        return Persistent.get(key);
-      },
-      isset: (key: string): any => {
-        this.logDeprecated('Persistent', 'isset');
-        return Persistent.isset(key);
-      },
-      load: (data: any): any => {
-        this.logDeprecated('Persistent', 'load');
-        return Persistent.load(data);
-      },
-      removeFromList: (key: string, value: string): any => {
-        this.logDeprecated('Persistent', 'removeFromList');
-        return Persistent.removeFromList(key, value);
-      },
-      set: (key: string, value: string): any => {
-        this.logDeprecated('Persistent', 'set');
-        return Persistent.set(key, value);
-      },
-      unset: (key: string): any => {
-        this.logDeprecated('Persistent', 'unset');
-        return Persistent.unset(key);
-      },
-    };
-  }
-
-  private logDeprecated = (className: string, methodName: string): any => {
-    if (console) {
-      console.warn(
-        'top.TYPO3.Storage.' + className + '.' + methodName + '() is marked as deprecated since TYPO3 v9 and will be '
-        + 'removed in TYPO3 v10.',
-      );
-    }
-  }
-}
-
-let storageObject;
-try {
-  // fetch from opening window
-  if (window.opener && window.opener.TYPO3 && window.opener.TYPO3.Storage) {
-    storageObject = window.opener.TYPO3.Storage;
-  }
-
-  // fetch from parent
-  if (parent && parent.window.TYPO3 && parent.window.TYPO3.Storage) {
-    storageObject = parent.window.TYPO3.Storage;
-  }
-
-  // fetch object from outer frame
-  if (top && top.TYPO3.Storage) {
-    storageObject = top.TYPO3.Storage;
-  }
-} catch (e) {
-  // this only happens if the opener, parent or top is some other url (eg a local file)
-  // which loaded the current window. Then the browser's cross domain policy jumps in
-  // and raises an exception.
-  // for this case we are safe and we can create our global object below.
-}
-
-if (!storageObject) {
-  storageObject = new Storage();
-}
-
-TYPO3.Storage = storageObject;
-export = storageObject;
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Storage.js b/typo3/sysext/backend/Resources/Public/JavaScript/Storage.js
deleted file mode 100644 (file)
index 52c4a9e..0000000
+++ /dev/null
@@ -1,13 +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!
- */
-define(["require","exports","./Storage/Client","./Storage/Persistent"],function(e,t,n,r){"use strict";var o,i=function(){var e=this;this.logDeprecated=function(e,t){console&&console.warn("top.TYPO3.Storage."+e+"."+t+"() is marked as deprecated since TYPO3 v9 and will be removed in TYPO3 v10.")},this.Client={clear:function(){e.logDeprecated("Client","clear"),n.clear()},get:function(t){return e.logDeprecated("Client","get"),n.get(t)},isset:function(t){return e.logDeprecated("Client","isset"),n.isset(t)},set:function(t,r){return e.logDeprecated("Client","set"),n.set(t,r)},unset:function(t){return e.logDeprecated("Client","unset"),n.unset(t)}},this.Persistent={addToList:function(t,n){return e.logDeprecated("Persistent","addToList"),r.addToList(t,n)},clear:function(){e.logDeprecated("Persistent","clear"),r.clear()},get:function(t){return e.logDeprecated("Persistent","get"),r.get(t)},isset:function(t){return e.logDeprecated("Persistent","isset"),r.isset(t)},load:function(t){return e.logDeprecated("Persistent","load"),r.load(t)},removeFromList:function(t,n){return e.logDeprecated("Persistent","removeFromList"),r.removeFromList(t,n)},set:function(t,n){return e.logDeprecated("Persistent","set"),r.set(t,n)},unset:function(t){return e.logDeprecated("Persistent","unset"),r.unset(t)}}};try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Storage&&(o=window.opener.TYPO3.Storage),parent&&parent.window.TYPO3&&parent.window.TYPO3.Storage&&(o=parent.window.TYPO3.Storage),top&&top.TYPO3.Storage&&(o=top.TYPO3.Storage)}catch(e){}return o||(o=new i),TYPO3.Storage=o,o});
\ No newline at end of file
index 74ba190..fe6b16a 100644 (file)
@@ -1061,6 +1061,11 @@ The following php doc annotations have been removed:
 * `@validate`
 
 
+The following JavaScript modules have been removed:
+
+* `TYPO3/CMS/Backend/Storage` - Use either `TYPO3/CMS/Backend/Storage/Client` or `TYPO3/CMS/Backend/Storage/Persistent`
+
+
 Impact
 ======