[BUGFIX] Replace "without" with native JavaScript 40/42940/5
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 31 Aug 2015 12:34:32 +0000 (14:34 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 8 Sep 2015 21:01:38 +0000 (23:01 +0200)
"without" is a Prototype function which was removed earlier. The function
creates a clone of an array without the given element. The certain part
using this function is rewritten to native JavaScript.

Resolves: #69432
Releases: master
Change-Id: I23c83ded58d042d693be8bdbf92f5f5ae48aa5b6
Reviewed-on: http://review.typo3.org/42940
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
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/jsfunc.inline.js

index ce4381a..43dbe89 100644 (file)
@@ -777,10 +777,14 @@ var inline = {
        memorizeRemoveRecord: function (objectName, removeUid) {
                var formObj = document.getElementsByName(objectName);
                if (formObj.length) {
-                       var parts = [];
+                       var parts = [],
+                               indexOfRemoveUid = -1;
                        if (formObj[0].value.length) {
                                parts = formObj[0].value.split(',');
-                               parts = parts.without(removeUid);
+                               indexOfRemoveUid = parts.indexOf(removeUid);
+                               if (indexOfRemoveUid !== -1) {
+                                       delete parts[indexOfRemoveUid];
+                               }
                                formObj[0].value = parts.join(',');
                                if (TBE_EDITOR) {
                                        TBE_EDITOR.fieldChanged_fName(objectName, formObj);