[BUGFIX] Lost page id after editing record out of Workspace Module
authorOliver Hader <oliver@typo3.org>
Sun, 18 Nov 2012 12:57:06 +0000 (13:57 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 19 Nov 2012 07:03:28 +0000 (08:03 +0100)
Given are those steps to reproduce:
* select a sub page in page tree
* open workspace module
* edit one of the workspace elements there
* save or close the editing process
* view is redirected to page id "0"

Encoding in the Javascript part to forward a correct returnUrl
is wrong. Instead of manually escaping sequences,
encodeURIComponent can be used.

Change-Id: Idda427015deb4595cc4e2c32542ba2d7a644e2b3
Fixes: #43049
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/16550
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/workspaces/Resources/Public/JavaScript/configuration.js

index 000b1d3..b036ade 100644 (file)
@@ -276,7 +276,7 @@ TYPO3.Workspaces.Configuration.RowButtons = {
                        tooltip: TYPO3.l10n.localize('tooltip.editElementAction'),
                        handler: function(grid, rowIndex, colIndex) {
                                var record = TYPO3.Workspaces.MainStore.getAt(rowIndex);
-                               var newUrl = 'alt_doc.php?returnUrl=' + Ext.urlEncode({}, document.location.href).replace("?","%3F").replace("=", "%3D").replace(":","%3A").replace("/", "%2f") + '&id=' + TYPO3.settings.Workspaces.id + '&edit[' + record.json.table + '][' + record.json.uid + ']=edit';
+                               var newUrl = 'alt_doc.php?returnUrl=' + encodeURIComponent(document.location.href) + '&id=' + TYPO3.settings.Workspaces.id + '&edit[' + record.json.table + '][' + record.json.uid + ']=edit';
                                window.location.href = newUrl;
                        },
                        getClass: function(v, meta, rec) {