[BUGFIX] Convert colPos in backend layout wizard to number 80/46880/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 24 Feb 2016 18:12:57 +0000 (19:12 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 25 Feb 2016 16:35:44 +0000 (17:35 +0100)
The method `setColumn` in the backend layout wizard sanitizes the
value by wrapping it into a <p> tag and fetching its text which strips
off any HTML. This returns a string.

However, the code later checks after performing a save action whether
the value is a number. The value gets converted to a number in
`setColumn` to recover the functionality.

Change-Id: I686657e170668adf71f278fa537aa5510e3e2241
Resolves: #73656
Releases: master
Reviewed-on: https://review.typo3.org/46880
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Resources/Public/JavaScript/GridEditor.js

index 69ce3a4..8c94237 100644 (file)
@@ -326,7 +326,9 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity', 'boot
         */
        GridEditor.setName = function(newName, col, row) {
                var cell = GridEditor.getCell(col, row);
-               if (!cell) return false;
+               if (!cell) {
+                       return false;
+               }
                cell.name = GridEditor.stripMarkup(newName);
                return true;
        };
@@ -346,7 +348,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity', 'boot
                if (!cell) {
                        return false;
                }
-               cell.column = GridEditor.stripMarkup(newColumn);
+               cell.column = parseInt(GridEditor.stripMarkup(newColumn), 10);
                return true;
        };