Bug #67259
closedaddToAllTCAtypes does not work with replace position
100%
Description
I am using addToAllTCAtypes
to extend an field with a Palette like this:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( 'tx_myext_entities', 'header;;pl_header;;', '', 'replace:header' );
The types of the tx_myext_entities table looks like this:
return array( 'ctrl' => array( 'title' => 'tx_myext_entities', ), 'interface' => array( 'showRecordFieldList' => 'header' ), 'columns' => array( 'header' => array ( 'exclude' => 1, 'label' => 'Header', 'config' => array ( 'type' => 'input', 'size' => '255', ) ) ), 'types' => array( '0' => array('showitem' => 'header') ), 'palettes' => array ( '1' => array('showitem' => ''), ) );
With TYPO3 6.2.11 and before i get the folowing result after the addToAllTCAtypes
call:
return array( 'ctrl' => array( 'title' => 'tx_myext_entities', ), 'interface' => array( 'showRecordFieldList' => 'header' ), 'columns' => array( 'header' => array ( 'exclude' => 1, 'label' => 'Header', 'config' => array ( 'type' => 'input', 'size' => '255', ) ) ), 'types' => array( '0' => array('showitem' => 'header;;pl_header;;') ), 'palettes' => array ( '1' => array('showitem' => ''), ) );
That is what I want!
Since TYPO3 6.2.12 the header field was not replaced anymore.
The remaining calls to add the palette and te new columns i have omitted the sake of clarity.
I have found out, that the removeDuplicatesForInsertion
method is the cause. This Method removes all duplicates, but ignores the insert position "replace", so a replace of an field is not possible.
This error exists since the fix in #65480 wit the following commit:
[BUGFIX] Compare field names without configuration With patch https://review.typo3.org/34019/ the function ExtensionManagementUtility::removeDuplicatesForInsertion was rewritten. But the rewrite fails for fields with additional configuration and returns wrong field information. Resolves: #65480 Releases: master, 6.2 Change-Id: I9aa35cd7ef5142e7b57489bf6e19a78811b8c335 Reviewed-on: http://review.typo3.org/38528 Reviewed-by: Markus Klein <klein.t3@reelworx.at> Tested-by: Markus Klein <klein.t3@reelworx.at> Reviewed-by: Xavier Perseguers <xavier@typo3.org> Tested-by: Xavier Perseguers <xavier@typo3.org> Reviewed-on: http://review.typo3.org/38610
Updated by Markus Klein over 9 years ago
- Description updated (diff)
- Target version set to 6.2.13
- Sprint Focus set to Stabilization Sprint
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39910
Updated by Stephan Großberndt over 9 years ago
- Is Regression changed from No to Yes
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39910
Updated by Markus Klein over 9 years ago
- Assignee set to Markus Klein
- Complexity set to easy
@ rengaw83: Please test the linked patch and vote. Thanks.
Updated by Markus Klein over 9 years ago
If it works then also please vote "verified +1".
Updated by Gerrit Code Review over 9 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39920
Updated by Markus Klein over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9a527d5402952f7dfc065ed9dd8a6e0eb9ef052f.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed