Bug #54530
closedFAL Media Element cannot be expanded when fieldname contains undescores
100%
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
Updated by Frans Saris almost 11 years ago
Are you sure you have no configuration errors?
Did a FAL implementation for ext:news with a underscore in the fieldname and it works.
See https://review.typo3.org/#/c/25550/
Only difference is it only has 1 underscore.
Updated by Thomas Schwarz almost 11 years ago
- File TYPO3_CMS_6.1_irre_error.jpg TYPO3_CMS_6.1_irre_error.jpg added
- File TYPO3_CMS_6.1_irre_working_1.jpg TYPO3_CMS_6.1_irre_working_1.jpg added
- File TYPO3_CMS_6.1_irre_working_2.jpg TYPO3_CMS_6.1_irre_working_2.jpg added
I have the same problem.
Underscores in the DB are not the Problem. The Problem are the Phrase "_header" in the DB field name, in my examle "tx_mpcontent_header_icon".
With "_header" in the DB field name the post params of the ajax-request (on opening the irre element) looks like Firebug Screenshot 1 and gets no Content in Answer.
Without "_header" (renamed to "_dheader") the post params of the two ajax-request looks like Screenshot 2 and 3.
Updated by Robert Heinig over 10 years ago
This bug is caused in
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js
where in line 62 (TYPO3 6.2.3)
recordHeader.attr('id').replace('_header', ''),
is too aggressive.
This could be solved with
recordHeader.attr('id').replace(/_header$/, ''),
But a better solution would be to avoid replacing here at all.
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from next-patchlevel to 7.4 (Backend)
Updated by Riccardo De Contardi over 9 years ago
I see that the js line reported is still present in 7.4-dev (latest master)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version changed from 7.5 to 7 LTS
Updated by Gerrit Code Review about 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/44104
Updated by Gerrit Code Review about 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/44104
Updated by Mathias Schreiber about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 07ef3bfbb6702ecff09f1d861ed6e8d788b81d0e.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed