Project

General

Profile

Actions

Bug #20489

closed

loadPrototype() called in frontend editing without a valid doc instance.

Added by Jeff Segars almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-05-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using frontend editing with the edit forms appearing directly on the page (and not in a popup) the following fatal error is generated.

PHP Fatal error: Call to a member function loadPrototype() on a non-object in /Users/jsegars/Sites/typo3_src/trunk/t3lib/class.t3lib_tceforms.php on line 5136

This was caused by RFC #20229: Use new JS-function for loading prototype/scriptaculous/extJS which references $GLOBALS['SOBE']->doc directly in tceforms, which may be used in the frontend or the backend. When edit forms appear directly on the page, $GLOBALS['SOBE']->doc does not exist at all.

The most obvious solution was to add wrapper for the offending calls in t3lib_tceforms_fe as we've done in the past to handle the different methods of loading Javascript in the frontend and backend. In this case, there's more logic in the actual loading so a simple wrapper isn't the best solution.

We've seen this sort of problem pop up several times now, so I think the best solution is create a dummy instance of $GLOBALS['SOBE']->doc in the frontend context so that we don't have to worry about frontend or backend when using tceforms. The attached patch adds a new tsfeDoc to typo3/template.php and creates a dummy version of $GLOBALS['SOBE'] within tceforms_fe.

The only potential compatibility issue is that tceforms no longer includes tceforms_fe. This inclusion was for compatibility reasons, as tceforms and tceforms_fe used to be a part of the same file. Keeping the inclusion meant tceforms_fe was always included in the backend context and defining $GLOBALS['SOBE'] there caused lots of errors. With the addition of the autoloader recently, this change may not even be the minor issue that I originally thought it was :)

(issue imported from #M11166)


Files

0011166.diff (3.32 KB) 0011166.diff Administrator Admin, 2009-05-22 17:11
0011166_v2.diff (2.73 KB) 0011166_v2.diff Administrator Admin, 2009-05-27 22:07
0011166_v3.patch (3.08 KB) 0011166_v3.patch Administrator Admin, 2009-05-28 08:36

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #20229: Use new JS-function for loading prototype/scriptaculous/extJSClosedSteffen Kamper2009-03-23

Actions
Actions #1

Updated by Jeff Segars almost 15 years ago

Added v2 patch that applies cleanly to trunk. The concerns above about removing tceforms_fe inclusion within tceforms are no longer valid thanks to the autoloader.

Actions #2

Updated by Jeff Segars almost 15 years ago

Committed Olly's v3 patch to trunk in r5513.

Actions

Also available in: Atom PDF