[BUGFIX] Follow up: Remove icon doesn't work 10/28010/4
authorNicole Cordes <typo3@cordes.co>
Mon, 3 Mar 2014 22:18:51 +0000 (23:18 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 5 Mar 2014 22:43:53 +0000 (23:43 +0100)
With patch 6711c14 the function setFormValueManipulate was corrected but
if called it returns an array instead of the first form element. This
patch makes sure that the first object is always returned.

Resolves: #56221
Releases: 6.2
Change-Id: I03445afcb15d9323cd899974ac1cf378945e4ecb
Reviewed-on: https://review.typo3.org/28010
Reviewed-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index 0fa5c80..55c5dd6 100644 (file)
@@ -175,7 +175,7 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) {
        setFormValueManipulate = function(fName, type, maxLength) {
                var $formEl = FormEngine.getFormElement(fName);
                if ($formEl.length > 0) {
-                       var formObj = $formEl.get();
+                       var formObj = $formEl.get(0);
                        var localArray_V = new Array();
                        var localArray_L = new Array();
                        var localArray_S = new Array();
@@ -348,7 +348,7 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) {
                var $formEl = FormEngine.getFormElement(fieldName);
                if ($formEl.length > 0) {
                        // return the DOM element of the form object
-                       return $formEl.get();
+                       return $formEl.get(0);
                } else {
                        return null;
                }