[TYPO3-core] RFC Bug #17215: Numbering of colPos inconsistent

JoH asenau info at cybercraft.de
Sun Jan 23 15:44:58 CET 2011


This is an SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=17215

Branches:
trunk

Problem:
This happens when working with less than the default 4 columns:

TSconfig:
mod.SHARED.colPos_list = 0,2
works as expected, only normal and right columns are shown.

However, using
TCEFORM.tt_content.colPos.removeItems = 1,3
to remove left and border column from selection field in CE, the column 
numbering is incorrect. The above setting will remove the NORMAL and 
BORDER column. The numbering here is corresponding to the physical 
position in the BE:

0 = LEFT (should be NORMAL)
1 = NORMAL (should be LEFT)
2 = RIGHT
3 = BORDER

Solution:
removeItems ALSO affects the column view to make sure the user won't be 
able to create new content in a column that he is not allowed to use.

In the default column view it will just remove the column from the 
viewport. Still you can change the rest of the visible columns with 
mod.SHARED.colPos_list, but the user won't be able to see a column 
although listed in colPos_list, when he can't select it in the 
tt_content selectbox for colPos as well.

This is a new behaviour introduced in 4.5 as a fix of the inconsistent 
behaviour of former TYPO3 versions.

In the grid view the behaviour is slightly different, since the columns 
will not be removed to keep the look and feel of the viewport intact. 
They will just be marked with "no edit access" instead and show no 
content elements at all.

This behaviour would not break existing stuff, as long as the 
implementation is working as intended.

The bug is just about the array key used by getColPosListItemsParsed, 
which does NOT represent the actualy colPos Key used by the item, which 
can be found in the subarray that always contains [0] => Label and [1] 
=> colPos. After fixing that, the keys match each other, so removeItems 
works as expected.

Cheers

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 17215.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20110123/d6843936/attachment.txt>


More information about the TYPO3-team-core mailing list