Bug #17062
closedExtensions crash when using HTMLArea in FE
0%
Description
I have some problems using extensions that call HTMLArea in the FE. This is the case for cal (in FE edit mode) and FE News. I get the following error:
"Fatal error: Call to undefined function: getdyntablevelstate() in /is/htdocs/62050/www.fidis.net/typo3_src-4.1RC1/typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php on line 932 "
I use Typo3 version 4.1RC2 (respectively the HTMLArea that is included in this release) - I also tried the same extensions on my test server runnung version 4.0.5. Here everything works without a problem.
Issue seems to be present in versions 4.1RC1 and 4.1RC2
on my development system, running version 4.0.5, I could not replicate this issue.
(issue imported from #M5105)
Files
Updated by Steffen Kamper over 17 years ago
I can confirm this. This error comes with any FE-edit using rtehtmlarea.
This is the method that fails (class.tx_rtehtmlarea_base.php)
RTEarea['.$number.']["tceformsDynTabs"] = "' . $this->TCEform->getDynTabLevelState('-DIV') . '";';
this is only BE-related - does anybody knows how to disable for FE ?
Updated by Oliver Hader over 17 years ago
I confirm this bug. getDynTabLevelState() is used for disposal in (nested) tabs.
Updated by Oliver Hader over 17 years ago
Hm, that's strange. $this->TCEform should be a reference to t3lib_TCEforms or t3lib_TCEforms_FE (which extends t3lib_TCEforms). Do you use any special configuration or just by a regular admPanel?
Which PHP version are you using? Maybe there is a problem with references?
Updated by Oliver Hader over 17 years ago
I tested this on a host with PHP 4.3.10-18 and front-end editing of tt_content records. Unfortunately I could no reproduce the error.
Updated by Denis Royer over 17 years ago
I am using PHP 4.4.2 and configured htmlArea using TSconfig on the pages. Besides that, everything is standard Typo3 - therefore nothing special...
Updated by Steffen Kamper over 17 years ago
i made a test case where you see the error (4.1.0)
http://test.sk-typo3.de/
login (demo / demo) and go to the calendar, klick on a +
(php 4.4.1)
Updated by Oliver Hader over 17 years ago
Thanks Steffen for giving a realistic demo concerning the bug. The controller of the "cal" extension re-builds an own TCEforms like environment. But it's nested in t3lib_svbase (services) in this case and not in TCEforms.
The attached patch checks if the method getDynTabLevelState exists in the simulated pObj. Thus, it's possible to use the pi2 of RTEhtmlarea for individual front-end editing in extensions further on.
This error might also occur in guestbook, forum, blog or any other community extension in front-end that tries to provide editing by RTEhtmlarea for any front-end user.
Updated by Steffen Kamper over 17 years ago
Thanks Oliver for this very quick patch :-)
I appled it and as you see at my link, editing is not blocked any longer.
Can you tell me what I have to change to use the rte ? I still use the tx_rtehtmlarea_pi2 for that and create that with $RTEItem = $this->RTEObj->drawRTE
Updated by Oliver Hader over 17 years ago
@Steffen: Hm, was the RTE rendered e.g. in TYPO3 4.0.5 in the "cal" extension? Or in other words: Do you assume an additional bug in RTEhtmlarea?
Updated by Steffen Kamper over 17 years ago
Hi Oliver,
it was my fault, cause something changed in cal edit form that doesn't let work rte.
I wrote a little testextension, and rte works fine with it.
http://test.sk-typo3.de/index.php?id=7
If anyone wants to test i included the download.
so Oliver, thumbs up - your patch solve the problem !
Updated by Oliver Hader over 17 years ago
@Steffen: Great, I'm going to wait some more days for additional feedback before I'm going to put this onto the core-list as RFC.
@Markus: You had some problems with a guestbook. Can you confirm, that the provided patch solves the problem?
Updated by Kasper Ligaard over 17 years ago
I recieved two independent bug-reports on mth_feedit regarding this bug. Both have reported back, that the patch solves the problem.
Updated by Steffen Kamper over 17 years ago
@Tomas - i can't reproduce your error in BE. This also doesn't belong to this Bug (i think)
Updated by Steffen Kamper over 17 years ago
I was asked from some people who are not familar with diff-Files, so i uploaded the patched php-File
Updated by Markus Wllenweber over 17 years ago
OK i installed the patched php File from Steffen.
Now the guestbooks (sr_guestbook / ve_guestbook) work again.
Thanks a lot.
But how could i apply this patch without using Linux.
Is there a windows application to apply such patches?
Updated by Markus Wllenweber over 17 years ago
OK next Problem.
When i want to create a new event in the BE.
I will have two problems.
The first one is that i could not choose the calendar for the event
-> i go to list - create a new event - and than i can choose the calendar for this event. But when i want to choose one i will get a message session timeout please logout and in. This could i do how often i want.
And second problem - the rtehtmlarea will not be loaded to write a description for this event.
I only get the message the editor will be loaded please wait.
Thats all.
Updated by Oliver Hader over 17 years ago
Addition to the new bugs:
1) Session Timout - This seems to be a new bug. I might not been caused by RTE, is it? Could you please open a new bug-report for the "session timeout"?
2) RTE being loaded: Does RTE work for regular content elements (tt_content)? Is the "cal" extension using RTEs on hidden Tabs or whatever?
Updated by Markus Wllenweber over 17 years ago
mmmmhhhhhh.... I don't know but it seems to be a bug in the cal.
Because when i open the page to create a new event IE shows me an error message / scripterror.
line: 41
character: 504
error: necessary object
url: www.domain.com/typo3/alt_doc.php?returnUrl=db_list.php%3Fid%3D72%26table%3D&edit[tx_cal_event]3=edit
At description i can change to the "big rte array" and then rte will be loaded. But not in the "normal mode (with overvie of all event aspects.
But the endless session timeout i got every time.
The rte will be loaded for normal content.
And thanks for the patch tools but no one work with .patch files ;-(
Updated by Steffen Kamper over 17 years ago
i can't confirm the BE Bug. I tested with the (fresh installed) 4.1.0, cal last svn, and with IE and FF: No session timeout, no rte problem.
It sounds like any exts that don't work together. So please set up a new typo3 install and test again.
Updated by Markus Wllenweber over 17 years ago
OK new informations!
After i installed the current cal from http://svn.webempoweredchurch.org/calendar/downloads
it fix all problems with the session timeout and
the problems with the loading from the rtehtmlarea by editing an event.
So i say that there is an incompatibility with the cal from the ter and typo3 4.1 / rtehtmlarea 1.51 dev
Just update to current version of cal and the problems will be fixed!
greetings from germany
Markus
Updated by Steffen Kamper over 17 years ago
please follow my link in note 0012920
Updated by Steffen Kamper over 17 years ago
I have to make an additional note. It seems that rte-versions are quite different.
The patch works fine with rtehtmlarea 1.5.1dev and 4.1.
After setting up my little Testextension on 4.0.5 (with rte 1.4.3) I got rte with the well known message "editor is loading", nothing more.
I tried to setup 1.5.1dev on this system (including the patch) and the FE-rte works. But in BE the rte doesn't work any longer:
Fatal error: Call to a member function on a non-object in /typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php on line 524
which is in this line:
$RTEWidth = ($inline>getStructureDepth() > 0 ? ($inline->getStructureDepth()+1)*$inline->getLevelMargin() : 0);
I fear that all rte-versions are not compatible and for all users it's anyway a very confusing situation, which rte has to be used for which version. We can say, use latest TYPO3 with the 1.5.1dev, but as we know, there are some sites with older setups that won't be updated for next time.
So why it is not possible to get one version of rte working with all versions ?
Updated by Oliver Hader over 17 years ago
The RTEhtmlarea is a TYPO3 system extension and is developed with the core. Thus, IMO it doesn't make any sense to use RTEhtmlarea 1.5.1dev (which was developed for TYPO3 4.1) with TYPO3 4.0.x.
Updated by Steffen Kamper over 17 years ago
ok, make sense, but anyway you see the lot of questions / bugreportings concerning the rte. Do you think rte 1.5.1 now is stable enough ?
btw - i know from mac-users that rte still doesn't work with safari. As rte is one of the most important extensions for TYPO3 it should be improved like that (it don't meant that you have to do that ;-))
Updated by Oliver Hader over 17 years ago
Yepp, but must of the "bugs" concerning the RTE are due to using an old local installation with a newer Core or vice versa. I opened a feature request concerning this special issue #5178 which should/could be integrated to the Core in the future...
Well, if someone donates me a brand new mac-book I'd like to have a look to the Safari issue of RTEhtmlarea... ;-)
Updated by Steffen Kamper over 17 years ago
good way of sponsering .-)
I think you can change status to resolved, all users told that patch works fine with guestbooks/cal etc.
Updated by Oliver Hader over 17 years ago
Committed to SVN TYPO3_4-1.
This bugfix will be replaced with the patch of bug-id #5177 end of April 2007 if it proves that it has no negative side-effects in SVN Trunk.