Issue Bug Closed

#77221IRRE: l10n_mode (=exclude) not evaluated for translated children

M. Stichweh 07/22/16, 16:16 updated 03/18/26, 19:18

Description

A language overlayed $row should be given to the mapRecordTypeToIconIdentifier method to determin the icon class.
That the type of an entity is not needed to be translated should be very common.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 8

  1. M. Stichweh commented <span data-processor="relativetime" data-value="2016-07-26T18:15:01+00:00" > 07/26/16, 18:15 </span>

    I have temporary fixed it with a Xclass of IconFactory:

    class IconFactory extends \TYPO3\CMS\Core\Imaging\IconFactory
    {
        public function mapRecordTypeToIconIdentifier( $table, array $row )
        {
            if( isset( $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'] ) && 
                    isset( $GLOBALS['TCA'][$table]['ctrl']['languageField'] ) &&
                    isset( $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] ) &&
                    $GLOBALS['TCA'][$table]['columns'][$GLOBALS['TCA'][$table]['ctrl']['typeicon_column']]['l10n_mode'] === 'exclude' &&
                    isset( $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] ) && 
                    isset( $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] ) ) 
            {
                $sysLanguageUid = $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']];
                $sysLanguageUid = is_array( $sysLanguageUid )? (int)array_shift( $sysLanguageUid ) : (int)$sysLanguageUid;
                if( $sysLanguageUid > 0 )
                {
                    $parentUid = $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']];
                    $parentUid = is_array( $parentUid )? (int)array_shift( $parentUid ) : (int)$parentUid;
                    if( $parentUid )
                    {
                        $column = $GLOBALS['TCA'][$table]['ctrl']['typeicon_column'];
                        if( $rowDefaultLang = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord( $table, $parentUid, $column ) )
                        {
                            $row[$column] = $rowDefaultLang[$column];
                        }
                    }
                }
            }
    
            return parent::mapRecordTypeToIconIdentifier( $table, $row );
        }
    }
  2. Markus Klein commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2016-08-02T22:10:42+00:00" > 08/02/16, 22:10 </span>

    I’m not sure where the exact bug really is. Actually the row passed into that function should be “ready” (meaning record overlays applied, etc).
    Then the value of the typeicon_column should be correct and exclude-mode needs no extra handling anymore.

    Can you elaborate how you use that function?

  3. M. Stichweh commented <span data-processor="relativetime" data-value="2016-08-15T10:47:45+00:00" > 08/15/16, 10:47 </span>

    Markus Klein wrote:
    > I’m not sure where the exact bug really is. Actually the row passed into that function should be “ready” (meaning record overlays applied, etc).
    > Then the value of the typeicon_column should be correct and exclude-mode needs no extra handling anymore.
    >
    > Can you elaborate how you use that function?

    An example of a TCA configuration could be:

    $GLOBALS['TCA']['tx_child'] = array(
        'ctrl' => array(
            'title'    => 'Child',
            'label' => 'typecolumn',
            ...,
            'origUid' => 't3_origuid',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
            'transOrigDiffSourceField' => 'l10n_diffsource',
            'delete' => 'deleted',
            'type' => 'typecolumn',
            'typeicon_column' => 'typecolumn',
            'typeicon_classes' => array(
                '' => 'type-unknown',
                'A' => 'type-a',
                'B' => 'type-b',
                'C' => 'type-c',
            )
        ),
        'columns' => array(
            ...,
            'typecolumn' => array(
                'exclude' => 0,            
                'l10n_mode' => 'exclude',
                'l10n_display' => 'defaultAsReadonly',
                'label' => 'Type',
                'config' => array(
                    'type' => 'input',
                    'size' => 1,
                    'eval' => 'trim'
                ),
            ),
            'parent' => array(
                'config' => array(
                    'type' => 'passthrough',
                )
            )
        )
    );
    
    $GLOBALS['TCA']['tx_parent'] = array(
        'ctrl' => array(
            'title'    => 'Parent',
            'label' => 'title',
            ...,
            'origUid' => 't3_origuid',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
            'transOrigDiffSourceField' => 'l10n_diffsource',
            'delete' => 'deleted'
        ),
        'columns' => array(
            ...,
            'children' => array(
                'exclude' => 0,
                'label' => 'Children',
                'config' => array(
                    'type' => 'inline',
                    'foreign_table' => 'tx_child',
                    'foreign_field' => 'parent',
                    'maxitems'      => 9999,
                    'foreign_default_sortby' => 'typecolumn',
                    'appearance' => array(
                        'levelLinksPosition' => 'top',
                        'showSynchronizationLink' => 0,
                        'showPossibleLocalizationRecords' => 1,
                        'showAllLocalizationLink' => 1,
                        'expandSingle' => 1,
                        'collapseAll' => 1,
                        'useSortable' => 0,
                        'enabledControls' => array(
                            'info' => 0,
                            'new' => 1,
                            'dragdrop' => 0,
                            'sort' => 0,
                            'hide' => 0,
                            'delete' => 1,
                            'localize' => 1,
                        ),
                    ),
                    'behaviour' => array(
                        'localizationMode' => 'select',
                        'localizeChildrenAtParentLocalization' => true,
                        'disableMovingChildrenWithParent' => true,
                    )
                )
            )
        )
    );

    The non-localized column typecolumn is used as type. All inline entries of a localized parent has an empty value for typecolumn and the type class will always be type-unknown.

  4. Markus Klein changed subject The TCA configs typeicon_column and typeicon_classes are not working on non-translatable fields (l10n_mode is set to exclude) IRRE: l10n_mode (=exclude) not evaluated for translated children <span data-processor="relativetime" data-value="2016-08-15T11:08:01+00:00" > 08/15/16, 11:08 </span>

  5. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2026-01-23T10:36:04+00:00" > 01/23/26, 10:36 </span>

    I cannot reproduce this anymore in v14. Can somebody else verify this? I suppose this is fixed with Schema API.

  6. Markus Klein commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-03-18T19:18:10+00:00" > 03/18/26, 19:18 </span>

    Closing due to the lack of feedback.