[TYPO3-core] FYI: fixed bug 6340: rtehtmlarea not working with "Editforms on page" option

Andreas Otto andreas.otto at dkd.de
Tue Oct 16 10:42:52 CEST 2007


Stanislas Rolland wrote:

> Problem:
> Apparently, the BE somewhere creates a $TSFE object (but without the
> usual structure found in the FE).
> 
> Solution:
> Determine that we are executing in the FE by testing not only the
> existence of the $TSFE object but also the id of the form of which the
> edited textarea is part.

I am currently working on a FE plugin which allows the editing of records
and renders the whole form using t3lib_TCEforms_FE. I do initialize
TCEforms like this:

$this->tceforms = t3lib_div::makeInstance('t3lib_TCEforms_FE');
$this->tceforms->prependFormFieldNames = 'TSFE_EDIT[data]';
$this->tceforms->prependFormFieldNames_file = 'TSFE_EDIT_file';
$this->tceforms->doSaveFieldName = 'TSFE_EDIT[doSave]';
$this->tceforms->formName
= 'TSFE_EDIT_FORM_'.substr($GLOBALS['TSFE']->uniqueHash(),0,4);
$this->tceforms->disableWizards = true;
$this->tceforms->disableRTE = false;
$this->tceforms->backPath = TYPO3_mainDir;
$this->tceforms->defStyle = '';
$this->tceforms->edit_showFieldHelp = '';
$this->tceforms->helpTextFontTag='';

Before your changes to rtehtmlarea the RTE was loading fine but now I do get
a JS error.

document.getElementById(currentElement) has no properties
http://typo3-scm.gimli.local/typo3temp/rtehtmlarea_htmlarea_84786c4bc50a8972739f17c158438fb8-compressed.js
Line 40

Line 40 contains:

this._iframe.style.width="100%";if(HTMLArea.is_opera)this._iframe.style.width=iframeWidth;this._textArea.style.width=textareaWidth;};HTMLArea.prototype.getDimensions=function(
{return{toolbar
{width:this._toolbar.offsetWidth,height:this._toolbar.offsetHeight},statusbar
{width:this._statusBar.offsetWidth,height:this._statusBar.offsetHeight}};};HTMLArea.prototype.accessParentElements=function(parentElements,callbackFunc
{var result={};if(parentElements.length){var
currentElement=parentElements.pop();var
elementStyle=document.getElementById(currentElement).style;var
actionRequired=(elementStyle.display=='none'?true:false);if(actionRequired
{var originalVisibility=elementStyle.visibility;var
originalPosition=elementStyle.position;elementStyle.visibility='hidden';elementStyle.position='absolute';elementStyle.display='';}

I guess this is related to the change from checking is_object($TSFE) to
checking for $this->is_FE().

Do you have any ideas how to solve the issue?


Cheers,
Andreas


More information about the TYPO3-team-core mailing list