[TYPO3-core] RFC: Bug #11834: Field handling API in t3lib_extMgm does not check for duplicates on insertion and runs superflouos insertions

Rupert Germann rupi at gmx.li
Sun Sep 20 14:38:44 CEST 2009


hi olly
+1 by reading and testing

greets
rupert


Oliver Hader schrieb:
> Oliver Hader schrieb:
>> This is an SVN patch request.
>>
>> Type: Bugfix
>>
>> Bugtracker references:
>> http://bugs.typo3.org/view.php?id=11834
>>
>> Branch: Trunk
>>
>> Problem:
>> The method t3lib_extMgm::addToAllTCAtypes() does not check for
>> duplicates on insertion. Furthermore
>> t3lib_extMgm::addFieldsToAllPalettesOfField() runs superflouos
>> insertions even if an accordant palette was already processed.
>>
>> Examples:
>> t3lib_extMgm::addToAllTCAtypes('table', 'fieldA, fieldA, fieldB');
>> will add 'fieldA, fieldA, fieldB' and thus 'fieldA' twice to the
>> rendering definition.
>>
>> t3lib_extMgm::addFieldsToAllPalettesOfField('table', 'fieldWithPalette',
>> 'fieldA, fieldB');
>> will add some superflouos commas field list of the palette.
>>
>> Solution:
>> Rewrite the duplicate check in removeDuplicatesForInsertion(). A
>> side-effect is, that the preg_replace() could be removed. The method
>> signature has been changed and the existing arguments were exchanged -
>> that does not hurt since this method is protected and was introduced
>> with 4.3, so, no other dependencies.
>>
>> The superflous insertion is caught by checking whether a palette was
>> already processed.
>>
>> Notes:
>> The "v2_ws" patch was created without showing changes to whitespaces.
>> There are already core unit tests in the suite "t3lib_extmgm_testcase".
>> The canAddFields[whatever] tests are currently failing and will be green
>> after applying the patch.
>>
>> olly
> 
> 
> Haha, great that I forgot to set the subject... here it is ^^^
> 
> olly


More information about the TYPO3-team-core mailing list