[TYPO3-core] RFC: Bug #<issue>:

Oliver Hader oliver at typo3.org
Mon Aug 31 20:01:46 CEST 2009


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
-- 
Oliver Hader
TYPO3 Release Manager 4.3


More information about the TYPO3-team-core mailing list