[BUGFIX] Fix jumpToUrl()-Usage in Element Browser 89/23889/3
authorBenjamin Pick <b.pick@yellowtree.de>
Wed, 18 Sep 2013 14:53:44 +0000 (16:53 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 26 Sep 2013 22:05:35 +0000 (00:05 +0200)
The Javascript functions jumpToUrl(URL,anchor) and jumpToUrl(URL,formEl)
cannot be used interchangeably. This leads to a javascript error,
because the formElement is rendered as string
("[object HTMLInputElement]").

Resolves: #50437
Releases: 6.0, 6.1, 6.2
Change-Id: I53e1be3c157a2ef6c646f02af15e8c746b6e6375
Reviewed-on: https://review.typo3.org/23889
Reviewed-by: Eric Chavaillaz
Tested-by: Eric Chavaillaz
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Henrik Ziegenhain
Tested-by: Henrik Ziegenhain
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/rtehtmlarea/Classes/SelectImage.php

index e7b604a..a0599b2 100644 (file)
@@ -516,7 +516,7 @@ class ElementBrowser {
                        function jumpToUrl(URL,anchor) {        //
                                var add_act = URL.indexOf("act=")==-1 ? "&act=' . $this->act . '" : "";
                                var add_mode = URL.indexOf("mode=")==-1 ? "&mode=' . $this->mode . '" : "";
-                               var theLocation = URL + add_act + add_mode + add_href + add_target + add_class + add_title + add_params' . ($addPassOnParams ? '+"' . $addPassOnParams . '"' : '') . '+(anchor?anchor:"");
+                               var theLocation = URL + add_act + add_mode + add_href + add_target + add_class + add_title + add_params' . ($addPassOnParams ? '+"' . $addPassOnParams . '"' : '') . '+(typeof(anchor)=="string"?anchor:"");
                                window.location.href = theLocation;
                                return false;
                        }
index ec8a020..ab67c4a 100644 (file)
@@ -357,7 +357,7 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                var cur_width = selectedImageRef ? "&cWidth="+selectedImageRef.style.width : "";
                                var cur_height = selectedImageRef ? "&cHeight="+selectedImageRef.style.height : "";
 
-                               var theLocation = URL+add_act+add_editorNo+add_sys_language_content+RTEtsConfigParams+cur_width+cur_height+(anchor?anchor:"");
+                               var theLocation = URL+add_act+add_editorNo+add_sys_language_content+RTEtsConfigParams+cur_width+cur_height+(typeof(anchor)=="string"?anchor:"");
                                window.location.href = theLocation;
                                return false;
                        }