[TYPO3-core] RFC #16096 Bug: addToAllTCATypes after certain fields does not work anymore

JoH asenau info at cybercraft.de
Tue Dec 14 23:22:17 CET 2010


Hi,

This is an SVN patch request.

Type: bug

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

Branches:
4.5, trunk

Problem:
Since the restructuring of the pallettes and fields the addToAllTCAtypes after:fieldname does not work anymore.. 

To test try:
t3lib_extMgm::addToAllTCAtypes("tt_content", 'subheader;;8', '', 'after:header'); 

The field gets added to an empty tab.

Additional Problem:
After trying to put the fields into the palettes containing the fieldname to position the field before or after, I found out, that this will lead to multiple field entries as soon as the fieldnames differ for certain types.

i.e.:
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','1',);
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','2','after:no_cache');
t3lib_extMgm::addToAllTCAtypes('pages','tx_dampages_files','3','after:media');

would lead to a triple entry for page type 1, since this is using both palettes, no_cache and media, and gets the field appended as well due to the fact that there is no position given in line 1.

Solution:
After discussing this with Steffen K. and Ernesto, we came to the conclusion that the only option we've got is to position the field as a separate field entry after or before the whole PALETTE containing the fieldname used for the position.

Attached patch does exactly this.

We will need removeFromAllTCATypes and replaceInAllTCATypes as well, to avoid the simple string replacement workarounds that are currently used by extension developers but might break TCA settings, but this will be done in another RFC.

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 --------------
A non-text attachment was scrubbed...
Name: 16096.diff
Type: application/octet-stream
Size: 1947 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101214/f644d039/attachment.obj>


More information about the TYPO3-team-core mailing list