Actions
Bug #58142
closedBackend layout, empty colpos breaks JS
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2014-04-23
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:
Description
Consider the following TS:
backend_layout { colCount = 3 rowCount = 3 rows { 1 { columns { 1 { name = Top left } 2 { name = top middle 0 colPos = 0 } 3 { name = top right 1 colPos = 1 } } } 2 { columns { 1 { name = middle left 2 colPos = 2 } 2 { name = middle middle 3 colPos = 3 } 3 { name = middle right 4 colPos = 4 } } } 3 { columns { 1 { name = lower left colPos = 5 } 2 { name = lower middle -1 colPos = -1 } 3 { name = colPos = } } } } }
This results in the following JS:
t3Grid = new TYPO3.Backend.t3Grid({ data: [[{colspan:1,rowspan:1,name:'Top left'},{colspan:1,rowspan:1,name:'top middle 0',column:0},{colspan:1,rowspan:1,name:'top right 1',column:1}],[{colspan:1,rowspan:1,name:'middle left 2',column:2},{colspan:1,rowspan:1,name:'middle middle 3',column:3},{colspan:1,rowspan:1,name:'middle right 4',column:4}],[{colspan:1,rowspan:1,name:'lower left',column:5},{colspan:1,rowspan:1,name:'lower middle -1',column:-1},{colspan:1,rowspan:1,name:'',column:}]], colCount: 3, rowCount: 3, targetElement: 'editor' });
This is invalid, because the column:}
must be column:''}
.
Removing the empty colPos =
statements makes the JS valid again, because the column property is not rendered.
Solution, check for empty colPos and cast this to a string.
Actions