[!!!][TASK] Remove deprecated `TYPO3.Utility` object 48/59348/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 6 Jan 2019 14:15:43 +0000 (15:15 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Sun, 6 Jan 2019 20:40:26 +0000 (21:40 +0100)
The global JavaScript object `TYPO3.Utility` has been removed.

Resolves: #87339
Releases: master
Change-Id: I50a6cd465aa914780c825152b7172df9b92173f3
Reviewed-on: https://review.typo3.org/59348
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/Resources/Private/TypeScript/Utility.ts
typo3/sysext/backend/Resources/Public/JavaScript/Utility.js
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst

index 1d98dcd..3854836 100644 (file)
@@ -140,9 +140,6 @@ class BackendController
         // load Toolbar class
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar');
 
-        // load Utility class
-        $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Utility');
-
         // load Notification functionality
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Notification');
 
index 895e880..d785d45 100644 (file)
@@ -24,7 +24,7 @@ class Utility {
    * @param {number} value
    * @returns {boolean}
    */
-  public isNumber = (value: number): boolean => {
+  public static isNumber(value: number): boolean {
     return !isNaN(parseFloat(value.toString())) && isFinite(value);
   }
 
@@ -35,7 +35,7 @@ class Utility {
    * @param {string} parameter
    * @returns {string}
    */
-  public getParameterFromUrl = (url: string, parameter: string): string => {
+  public static getParameterFromUrl(url: string, parameter: string): string {
     if (typeof url.split !== 'function') {
       return '';
     }
@@ -66,7 +66,7 @@ class Utility {
    * @param {string} value
    * @returns {string}
    */
-  public updateQueryStringParameter = (url: string, key: string, value: string): string => {
+  public static updateQueryStringParameter(url: string, key: string, value: string): string {
     const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
     const separator = url.indexOf('?') !== -1 ? '&' : '?';
 
@@ -77,8 +77,4 @@ class Utility {
   }
 }
 
-const utilityObject = new Utility();
-
-// @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Use the TYPO3/CMS/Backend/Utility module in AMD instead
-TYPO3.Utility = utilityObject;
-export = utilityObject;
+export = Utility;
index c244b9a..cb3ed7d 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports"],function(t,e){"use strict";var r=new function(){this.isNumber=function(t){return!isNaN(parseFloat(t.toString()))&&isFinite(t)},this.getParameterFromUrl=function(t,e){if("function"!=typeof t.split)return"";var r=t.split("?"),i="";if(r.length>=2)for(var n=r.join("?"),a=encodeURIComponent(e)+"=",o=n.split(/[&;]/g),u=o.length;u-- >0;)if(-1!==o[u].lastIndexOf(a,0)){i=o[u].split("=")[1];break}return i},this.updateQueryStringParameter=function(t,e,r){var i=new RegExp("([?&])"+e+"=.*?(&|$)","i"),n=-1!==t.indexOf("?")?"&":"?";return t.match(i)?t.replace(i,"$1"+e+"="+r+"$2"):t+n+e+"="+r}};return TYPO3.Utility=r,r});
\ No newline at end of file
+define(["require","exports"],function(e,t){"use strict";return function(){function e(){}return e.isNumber=function(e){return!isNaN(parseFloat(e.toString()))&&isFinite(e)},e.getParameterFromUrl=function(e,t){if("function"!=typeof e.split)return"";var n=e.split("?"),r="";if(n.length>=2)for(var i=n.join("?"),u=encodeURIComponent(t)+"=",o=i.split(/[&;]/g),a=o.length;a-- >0;)if(-1!==o[a].lastIndexOf(u,0)){r=o[a].split("=")[1];break}return r},e.updateQueryStringParameter=function(e,t,n){var r=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(r)?e.replace(r,"$1"+t+"="+n+"$2"):e+i+t+"="+n},e}()});
\ No newline at end of file
index 2c266e9..bc3a011 100644 (file)
@@ -1070,6 +1070,11 @@ The following JavaScript modules have been removed:
 * `TYPO3/CMS/Backend/Storage` - Use either `TYPO3/CMS/Backend/Storage/Client` or `TYPO3/CMS/Backend/Storage/Persistent`
 
 
+The following global instances have been removed:
+
+* `TYPO3.Utility` - require `TYPO3/CMS/Backend/Utility` in your AMD module
+
+
 Impact
 ======