Bug #52527
closed
ExtensionManagementUtility::addToAllTCAtypes() doesn't add field because of match on substring
Added by Peter Niederlag over 10 years ago.
Updated over 5 years ago.
Description
If you have a field 'great_categories' you can't add another field on the same table with addToAllTCAtypes() with a name of 'categories' as this field is considerd existing in the routine. this is most likely happening due to the use of
strpos($typeDetails['showitem'], $str) !== FALSE
$tmpField1 = array (
'fancy_field_test' => array(
'exclude' => 0,
'label' => 'first working test',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
)
)
);
$tmpField2 = array (
'test' => array(
'exclude' => 0,
'label' => 'second (failing) test',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim,required'
)
)
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tmpField1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCATypes('pages', 'fancy_field_test');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages',$tmpField2);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCATypes('pages', 'test');
tmpField2 won't show up :(
'test' is part of 'fancy_field_test'
reversing the registration order would fix it
- Status changed from New to Accepted
- Priority changed from Should have to Must have
- TYPO3 Version changed from 6.2 to 6.0
- Complexity set to medium
Should go to all 6.x versions I guess (and maybe even to 4.5).
Can you work on a patch (and put the example into a unit test)? This would be great.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
Also available in: Atom
PDF