Project

General

Profile

Actions

Bug #67259

closed

addToAllTCAtypes does not work with replace position

Added by rengaw83 almost 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Extension Manager
Target version:
Start date:
2015-06-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #65480: TYPO3 6.2.10 Flexform: Values of section elements are not displayedClosedNicole Cordes2015-03-03

Actions
Actions #1

Updated by Markus Klein almost 9 years ago

  • Description updated (diff)
  • Target version set to 6.2.13
  • Sprint Focus set to Stabilization Sprint
Actions #2

Updated by Gerrit Code Review almost 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

Actions #3

Updated by Stephan Großberndt almost 9 years ago

  • Is Regression changed from No to Yes
Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Markus Klein almost 9 years ago

  • Assignee set to Markus Klein
  • Complexity set to easy

@ rengaw83: Please test the linked patch and vote. Thanks.

Actions #6

Updated by rengaw83 almost 9 years ago

Thanks, works for me.

Actions #7

Updated by Markus Klein almost 9 years ago

If it works then also please vote "verified +1".

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Markus Klein almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF