Project

General

Profile

Actions

Bug #54530

closed

FAL Media Element cannot be expanded when fieldname contains undescores

Added by Jan Greth almost 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2013-12-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

When adding a new field to a existing table (e.g. pages) for adding Media (Images with custom palette) as IRRE, this field's name cannot have undescores ("_") in its name.

Otherwise the created IRRE Data cannot be expanded when saving this page and editing it again.

NOT working:

ext_tables.sql
[...]

#
# Table structure for table 'pages'
#
CREATE TABLE pages (

    slideshow tinyint(1) unsigned DEFAULT '0' NOT NULL,
    dynamic_header_images int(11) unsigned DEFAULT '0' NOT NULL,

);

[...]

ext_tables.php
[...]

$addColumnArray = array(
    'slideshow' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:slideshow_on_off',
        'config' => array(
            'type' => 'check'
        )
    ),
    '*dynamic_header_images*' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:dynamic_header_images',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('*dynamic_header_images*', array(
                'appearance' => array(
                    'createNewRelationLinkTitle' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:*dynamic_header_images*.add_reference',
                ),
                'foreign_types' => array(
                    '0' => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    )
                )
            ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
        ),
    ),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $addColumnArray);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', '--div--;LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:dynamic_header_tab,slideshow,*dynamic_header_images*');

$addColumnArray = array(
    'headline' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:headline',
        'config' => array(
            'type' => 'input',
            'size' => 48,
            'max' => 256
        )
    ),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $addColumnArray);

$GLOBALS['TCA']['sys_file_reference']['palettes']['dynamicHeaderPalette'] = array(
    'showitem' => 'title,alternative;;;;3-3-3,--linebreak--,link,description,--linebreak--,headline',
    'canNotCollapse' => TRUE
);

[...]

working:

ext_tables.sql
[...]

#
# Table structure for table 'pages'
#
CREATE TABLE pages (

    slideshow tinyint(1) unsigned DEFAULT '0' NOT NULL,
    dynamicheaderimages int(11) unsigned DEFAULT '0' NOT NULL,

);

[...]

ext_tables.php
[...]

$addColumnArray = array(
    'slideshow' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:slideshow_on_off',
        'config' => array(
            'type' => 'check'
        )
    ),
    '*dynamicheaderimages*' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:dynamicheaderimages',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('*dynamicheaderimages*', array(
                'appearance' => array(
                    'createNewRelationLinkTitle' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:*dynamicheaderimages*.add_reference',
                ),
                'foreign_types' => array(
                    '0' => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    ),
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;dynamicHeaderPalette,
                            --palette--;;filePalette'
                    )
                )
            ), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
        ),
    ),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $addColumnArray);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', '--div--;LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:dynamic_header_tab,slideshow,*dynamicheaderimages*');

$addColumnArray = array(
    'headline' => array(
        'exclude' => 1,
        'label' => 'LLL:EXT:mp_dynamicheader/Resources/Private/Language/locallang_db.xlf:headline',
        'config' => array(
            'type' => 'input',
            'size' => 48,
            'max' => 256
        )
    ),
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_file_reference', $addColumnArray);

$GLOBALS['TCA']['sys_file_reference']['palettes']['dynamicHeaderPalette'] = array(
    'showitem' => 'title,alternative;;;;3-3-3,--linebreak--,link,description,--linebreak--,headline',
    'canNotCollapse' => TRUE
);

[...]


Files

TYPO3_CMS_6.1_irre_error.jpg (54.6 KB) TYPO3_CMS_6.1_irre_error.jpg Firebug screenshot with "_header" Thomas Schwarz, 2014-01-20 12:05
TYPO3_CMS_6.1_irre_working_1.jpg (164 KB) TYPO3_CMS_6.1_irre_working_1.jpg Firebug screenshot with renamed db field (first request) Thomas Schwarz, 2014-01-20 12:05
TYPO3_CMS_6.1_irre_working_2.jpg (59.8 KB) TYPO3_CMS_6.1_irre_working_2.jpg Firebug screenshot with renamed db field (second request) Thomas Schwarz, 2014-01-20 12:05
Actions

Also available in: Atom PDF