Bug #17785
closedMultiple RTEs in Flexforms don't work properly
0%
Description
This situation: Two (or more) RTEs are located in different sheets in a flexform, you open the editing mask. Now you can only only enter text in the RTE in the active sheet. After switching to the other sheet you cannot focus on the input area. After saving, the page is rebuilt with the second sheet active, NOW you can enter text in this RTE, the RTE in the first sheet does not work any more.
Additionally the height of the sheet with the inactive RTE appears to be too little, the RTE overlaps other input fields.
When disabling the RTE, the input fields work out okay.
example flexform:
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.sheetgeneral</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<questionText>
<TCEforms type="array">
<config type="array">
<type>text</type>
<cols>48</cols>
<rows>5</rows>
</config>
<label>LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.questionText</label>
<defaultExtras>richtext[*]:rte_transform[mode=ts_css]</defaultExtras>
</TCEforms>
</questionText>
<answerType>
<TCEforms>
<label>LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.answerType</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.answerType.I.1</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.answerType.I.2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
</items>
<minitems>1</minitems>
<maxitems>1</maxitems>
<size>1</size>
</config>
</TCEforms>
</answerType>
</el>
</ROOT>
</sDEF>
<display>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.textAnswer</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<answerText>
<TCEforms type="array">
<config type="array">
<type>text</type>
<cols>48</cols>
<rows>5</rows>
</config>
<label>LLL:EXT:as_questionaire/locallang_db.xml:tt_content.pi_flexform.answerText</label>
<defaultExtras>richtext[*]:rte_transform[mode=ts_css]</defaultExtras>
</TCEforms>
</answerText>
</el>
</ROOT>
</display>
</sheets>
</T3DataStructure>
(issue imported from #M6706)
Files
Updated by Markus Kappe about 17 years ago
This problem also occurs with a single RTE on a sheet that is not active when the page ist loaded.
Updated by Christian Kuhn over 16 years ago
I can reproduce this bug in 4.2.1.
I attached a simple test extension based on your flexform.
Maybe someone takes a look at this.
Updated by Stanislas Rolland over 16 years ago
Using the test extension, I cannot reproduce the first part of this issue neither in 4.1.8-dev, nor in 4.3.0-dev using Firefox 3.
However, the layout is indeed awkward, but in different ways, in 4.1.8-dev and 4.3.0-dev.
To make sure that the first part of the issue is not related to incorrect installation, please delete all files in typo3temp/rtehtmlarea and all files with names starting with "rtehtmlarea_" in directory typo3temp.
Updated by Christian Kuhn over 16 years ago
Thanks Stan.
Part 1 (the focus issue) happens only in ff 2, I also can not reproduce this in ff 3, nor in Opera 9.50.
I can reproduce part1 with ff 2.0.0.14, on latest trunk and 4-2 branch: If I select the other tab after loading, click into the textarea and type in some text, then the "Quick find" bar in ff2 is opened with the typed text.
Updated by Stanislas Rolland over 16 years ago
I think that this is due to the fact that the flexform tabs are not included in TCEform->getDynNestedStack
Updated by Jan-Henrik Hempel about 15 years ago
In version 4.2.6 and 4.2.8 the problem that the RTE overlaps other input fields with in flexforms still appears.
Saving problems or anything like that, we counld not reproduce.
Updated by Juergen Deisenroth about 15 years ago
I tried to understand what produce the bug and analysed the javascript code. There are many objects rendered with the attribut "display:none" and they have no height and width when calling the function sizeIframe in htmlarea.js. For this reason it is not possible to calculate the tool- and statusbar dimensions in auto mode.
At a be extension with multiple rtes in tabs i could fix this with a string replace for "DTM_activate" and an own function named "DTM_activate" calling the original function and sizeIframe. Because sizeIframe makes the rte smaller with every call, I switch from auto to fix dimension and the function is only executed once for each tab.
I used this code snippet at the extension:
$this->doc->JScode .=
// ... DynTabMenu-Kode mit modifiziertem Namen der Aktivierungsfunktion laden
str_replace('DTM_activate', 'DTM_activateOrig', $this->doc->getDynTabMenuJScode())
// ... Eingene Aktivierungsfunktion definieren, welche die Originalfunktion aufruft und
// einmalig Größenkorrekturen für alle RTEs vornimmt.
.'<script language="javascript" type="text/javascript">'
.'function DTM_activate(idBase,index,doToogle) {'
// ... Originalfunktion ausführen
.'DTM_activateOrig(idBase,index,doToogle);'
// ... Größenkorrekturen für alle bereits angelegten RTEs ausführen.
// (Die RTEs werden am Skriptende angelegt, weshalb bei der erstmaligen Ausführung am
// Skriptanfang nur das Objekt mit den Versionsinformationen existiert).
.'if( typeof(RTEarea) != "undefined" ) {'
.'try {'
// Die Namen aller Objekteigenschaften analysieren: init, initEditor, 0, data[tx_....
.'for(var eigenschaft in RTEarea) {'
// Objektfunktionen und Versionsinformationen ignorieren, ferner muss mit der
// Eigenschaft ein Editor verknüpft sein und die Höhe muss automatisch bestimmt
// werden.
.'if( eigenschaft != "0"'
.' && typeof(RTEarea[eigenschaft]) "object"'
.' && typeof(RTEarea[eigenschaft].editor) "object"'
.' && RTEarea[eigenschaft].editor.config.height == "auto"'
.' ) {'
// auto-Modus durch fixe Angabe deaktivieren, weil der RTE sonst durch wiederholte
// Berechnungen immer kleiner wird.
.'RTEarea[eigenschaft].editor.config.height = '
.'RTEarea[eigenschaft].editor._textArea.style.height;'
// Dimensionen berechnen.
.'RTEarea[eigenschaft].editor.sizeIframe(2);'
.'}'
.'}'
.'} catch(err) {'
.'}'
.'}'
.'}'
.'</script>'
;
Updated by Stanislas Rolland about 14 years ago
The overlap issue was fixed in TYPO3 4.3 alpha2.
Updated by Stanislas Rolland about 14 years ago
This issue is fixed in TYPO3 4.3 branch.