Bug #71624
closedStory #69617: FormEngine bugs
Multiple RTEs behave incorrect, especially textstyle
100%
Description
TYPO3 7.6, Mac OS X 10.11.1, Chrome 47.0.2526.58 beta (64-bit), php 5.6.10, no opcode, no apc etc
Description:
Adding a new RTE text field (or re-defining an exisiting one) does not render the textstyle correctly. Instead, selecting some text in order to assign some styling to it, activates the textstyle box of the bodytext RTE, but with styles that are defined on the new field (via PageTS).
The behavior might need verification from other users.
Steps to reproduce:
1. In .../Overrides/tt_content.php redefine the header field to get an RTE assigned:
$GLOBALS['TCA']['tt_content']['columns']['header'] = array( 'config' => array( 'type' => 'text', 'cols' => '80', 'rows' => '3', 'wizards' => array( 'RTE' => array( 'notNewRecords' => 1, 'RTEonly' => 1, 'type' => 'script', 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.RTE', 'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif', 'module' => array( 'name' => 'wizard_rte' ) ), 'table' => array( 'notNewRecords' => 1, 'enableByTypeConfig' => 1, 'type' => 'script', 'title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.table', 'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif', 'module' => array( 'name' => 'wizard_table' ), 'params' => array( 'xmlOutput' => 0 ) ) ), // RTE does this automatically on all fields defined as text, but uses its own Overrides/tt_content.php // TODO: find out if the RTE's Overrides are parsed before this extension; if so, the following line can be removed //'softref' => 'rtehtmlarea_images,typolink_tag' ), // Important: this line only *ADDS* to the already existing configuration, so check any pageTsConfig 'defaultExtras' => 'richtext[]' ); unset($GLOBALS['TCA']['tt_content']['columns']['header']['config']['max']); unset($GLOBALS['TCA']['tt_content']['columns']['header']['config']['size']);
2. Add a pageTsConfig with this TypoScript:
RTE.default { contentCSS = EXT:sitesetup/Resources/Public/Css/rte.css proc.allowedClasses := addToList(color-header--secondary) buttons.textstyle.showTagFreeClasses = 0 buttons.textstyle.tags.span.allowedClasses = text-muted, text-warning, text-sucess [...] # different styles than in the header field RTE buttons.formatblock.removeItems = h1, h2, h3, pre, address, article, [...] } RTE.config.tt_content.header { toolbarOrder ( formatblock, textstyle [...] ) showButtons = formatblock, textstyle [...] buttons.formatblock.removeItems = h5, h6, pre, address,[...] buttons.formatblock.addItems = h2,h3,h4 buttons.textstyle.showTagFreeClasses = 1 buttons.textstyle.tags.span.allowedClasses = color-header--secondary # different styles than in the bodytext field RTE }
3. Add a RTE css file:
span.color-header--secondary { color: #df9700; } .color-header--secondary { color: #df9700; }
4. Write some text into the redefined header field, assign it a h1, select a partial text sequence of that header and try to assign it the textstyle "color-header--secondary".
Expected Behavior:
The textstyle dropdown of the header field RTE opens showing a list with one style, the color-header--secondary style. This style can be assign to the selected text section generating a <span class="color-header--secondary"> tag in the source code.
What really happens:
The textstyle box of the bodytext RTE is activated, showing -strangly enough - those style{s) that are defined in the header field RTE section. (A check in the bodytext shows that the classes appearing in the textstyle dropdown button are indeed those defined on the RTE.default-section...)
Added some images illustrating the behavior. This actually already used to work, so it seems to be a regression?
It wold be great, if someone could give feedback on whether (s)he experiences the same problem! Thank you!
Files