[BUGFIX] Replace ###ID### in openCustomUrlInContentFrame correctly 31/42731/5
authorChristian Seifert <christian-f-seifert@gmx.de>
Tue, 18 Aug 2015 20:31:19 +0000 (20:31 +0000)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 22 Aug 2015 11:09:52 +0000 (13:09 +0200)
Adding an URL by getModuleUrl including an array having an ID
parameter id=###ID### results in an escaped string.
Instead of "###ID###" the value "%23%23%23ID%23%23%23" is
submitted to the JavaScript function.

This patch fixes the old replacement function.
Now, you can again add click menu items linking to modules and
passing the selected page uid.

Resolves: #69170
Releases: master, 6.2
Change-Id: Ib4c0a1556dd1ed583e8faefe431e2d4eaaf864ad
Reviewed-on: http://review.typo3.org/42731
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/js/extjs/components/pagetree/javascript/actions.js

index bc8f523..f346586 100644 (file)
@@ -733,8 +733,12 @@ TYPO3.Components.PageTree.Actions = {
                }
 
                node.select();
+               var nodeId = node.attributes.nodeData.id,
+                       idPattern = '###ID###';
                TYPO3.Backend.ContentContainer.setUrl(
-                       contextItem.customAttributes.contentUrl.replace('###ID###', node.attributes.nodeData.id)
+                       contextItem.customAttributes.contentUrl
+                               .replace(idPattern, nodeId)
+                               .replace(encodeURIComponent(idPattern), nodeId)
                );
        },