Bug #16526

Moving content elements in frontent editing mode causes crash

Added by Beat Zimmerli almost 15 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2006-09-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When trying to move a content element up or down while in frontend editing mode, the following error appears:

Fatal error: Call to a member function on a non-object in (...)/typo3_src-4.0.1/t3lib/class.t3lib_tsfebeuserauth.php on line 1068

The problem can be fixed by replacing line 1068 in class.t3lib_tsfebeuserauth.php which reads:

$GLOBALS['TSFE']->sys_page->enableFields($table,'',$ignore),

with:

t3lib_pageSelect::enableFields($table,'',$ignore),

as it was in version 4.0 on line 1065.

This error is new in version 4.1

(issue imported from #M4160)


Files

class.t3lib_tsfebeuserauth-4160.diff (577 Bytes) class.t3lib_tsfebeuserauth-4160.diff Administrator Admin, 2006-09-08 11:57
bug-4160-4.0.x.-r0.diff (924 Bytes) bug-4160-4.0.x.-r0.diff Administrator Admin, 2007-03-12 13:11
bug-4160-4.1.x.-r0.diff (1.64 KB) bug-4160-4.1.x.-r0.diff Administrator Admin, 2007-03-12 13:11
bug_4160.diff (4.61 KB) bug_4160.diff Administrator Admin, 2007-04-18 15:26

Related issues

Related to TYPO3 Core - Bug #17978: Problem with cms\tslib\index_ts.phpClosedJeff Segars2008-01-11

Actions
Related to TYPO3 Core - Feature #18265: Add post processing hooks for Frontend EditingClosedJeff Segars2008-02-21

Actions
Has duplicate TYPO3 Core - Bug #16495: up/down buttons errorClosedKarsten Dambekalns2006-08-25

Actions
Has duplicate TYPO3 Core - Bug #17076: FE editing tools panel: change sort order crashClosedMichael Stucki2007-03-05

Actions
Has duplicate TYPO3 Core - Bug #17191: Error when trying to move elementsClosed2007-04-05

Actions
#1

Updated by Peter Niederlag almost 15 years ago

I can confirm this bug. to me this is a very serious one. I'll dig into it.

#2

Updated by Peter Niederlag almost 15 years ago

I attached Beat's solution as patch-file

#3

Updated by Peter Niederlag almost 15 years ago

since this problem was introduced by some patch to add better support for DBAL I am in contact with Karsten D. to find a solution.

Reverting to old behaviour (see attached patch) might cause problems again for DBAL.

#4

Updated by Anonymous almost 15 years ago

Our clients noticed the same problem.

#5

Updated by Martin Holtz almost 15 years ago

seems to be related to 4101

#6

Updated by Andreas Merkle over 14 years ago

with the fix that's described here - we get another problem: ext: sr_feuser_register_2.5.2.t3x (frontend user register) does not work anymore. I get a internal server error.
does anybody has a fix that works for both ?

#7

Updated by Christopher Hlubek over 14 years ago

Confirmed in our TYPO3 4.0.2 Installation. I'll test the patch now.

#8

Updated by Joerg Schuck over 14 years ago

I changed the line in my installation to
(($GLOBALS['TSFE']->sys_page instanceof t3lib_pageSelect) ? $GLOBALS['TSFE']->sys_page->enableFields($table,'',$ignore) : t3lib_pageSelect::enableFields($table,'',$ignore)),

I don't know if it works for both mentioned issues, but it should as it either uses the instantiated object, or the "raw" function.
Best of both worlds, so to speak.

#9

Updated by Steffen Kamper over 14 years ago

applying that patch i get the next:
Fatal error: Call to undefined function: getmultiplegroupswhereclause() in ...\home\t3lib\class.t3lib_page.php on line 975
(TYPO3 4.1beta2)

#10

Updated by Martin Holtz over 14 years ago

Hi,

$GLOBALS['TSFE']->sys_page
is empty at that point, there is no function enableFields in $GLOBALS['TSFE']->sys_page at that moment

#11

Updated by Martin Holtz over 14 years ago

this error is NOT new in Version 4.1
i got it in 4.0.5 too!

#12

Updated by Peter Niederlag over 14 years ago

this bug unfortunatly still persists. I digged into it again and also asked Karsten for some help since it is a DBAL concern that these lines were changed. I now added a check if the methods exist and a fallback to the static call.

I attached patchfiles for 4.0:
http://bugs.typo3.org/file_download.php?file_id=2355&type=bug (for 4.0)
and 4.1:
http://bugs.typo3.org/file_download.php?file_id=2356&type=bug (for 4.1)

both should cleanly apply to their appropriate typo3-version with a 'patch -p0 < /path/to/patchfile'

Peter

#13

Updated by Thorsten Kahler over 14 years ago

I attached a patch file (bug_4160.diff) that changes the sequence in index_ts.php.

I try to describe it in pseudo-code:
before:

// ...
init (FE user)
init (BE user))
if( admPanel enabled ) {
do_tsfebe_userauth_things()
}
TSFE->determineId() // TSFE->sys_page is initialized here!
if ( ! BE_USER->extPageReadAccess() ) {
// insufficient access rights of BE user
unset(BE_USER)
TSFE->determineId() // recheck current page (without being loged in as BE user
// start parsing TS setup
// ... (generate output etc.)

after:

// ...
init (FE user)
init (BE user))
TSFE->determineId() // TSFE->sys_page is initialized here!
if ( ! BE_USER->extPageReadAccess() ) {
// insufficient access rights of BE user
unset(BE_USER)
TSFE->determineId() // re-check current page (without being loged in as BE user
}
if( BE_USER && admPanel enabled ) {
do_tsfebe_userauth_things()
}
// start parsing TS setup
// ... (generate output etc.)

So the BE_USER is initialized like previous but the "things to do" are done AFTER the TSFE object is completely initialized. IMO this is more correct but it may as well cause errors. The patch has to be checked very thoroughly!

#14

Updated by Axel Klarmann about 14 years ago

Version 4.1.1 got this problem also.
How about the current status of the last patch? „The patch has to be checked very thoroughly!“ - are there any issues?

#15

Updated by Christian Ehret about 14 years ago

I can confirm this bug in 4.1.2, too. I'm wondering that nobody fixes this bug in the TYPO3 Source? I think it is an important feature?!
I manually applied the patch from Peter (http://bugs.typo3.org/file_download.php?file_id=2356&type=bug) - some line numbers changed - and it seems to work with 4.1.2.

#16

Updated by Thorsten Kahler almost 14 years ago

The bug is now fixed in SVN (branches TYPO3_4-0, TYPO3_4-1 and trunk).

Also available in: Atom PDF