Project

General

Profile

Actions

Bug #31839

closed

Error in tslib_fe->checkPageGroupAccess with realurl if page is not found

Added by Jaume Prat over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Must have
Category:
Content Rendering
Target version:
Start date:
2011-11-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

If you are using the realURL extension and realURL can't determine the requested page path, the method tslib_fe::pageNotFoundAndExit will be called.

Some function-calls later the method checkPageGroupAccess is called, and PHP will crash in line 1188 with this error:

PHP Fatal error:  Call to a member function getRootLine() on a non-object in typo3/sysext/cms/tslib/class.tslib_fe.php on line 1188

This happens because the object "$this->sys_page" is not set in the current tslib_fe instance (is only an empty string), it will be only created if the method "fetch_the_id" was called. But if realURL starts the 404-Error Handling "fetch_the_id" will be never called. So you must check if the object is available:

Code before patching:

// If the actual page has no fe_group, check the rootline for
// inherited fe_group due to extendToSubpage-property
if (intval($row['fe_group']) === 0) {

Code after patching:

// If the actual page has no fe_group, check the rootline for
// inherited fe_group due to extendToSubpage-property
if (intval($row['fe_group']) === 0 && $this->sys_page) {

Here is a backtrace:

typo3/sysext/cms/tslib/class.tslib_fe.php - tslib_fe->checkPageGroupAccess (1270)
typo3/sysext/cms/tslib/class.tslib_fe.php - tslib_fe->getPageAccessFailureReasons (1455)
typo3/sysext/cms/tslib/class.tslib_fe.php - tslib_fe->pageErrorHandler (1421)
typo3/sysext/cms/tslib/class.tslib_fe.php - tslib_fe->pageNotFoundHandler (1379)
typo3conf/ext/realurl/class.tx_realurl.php - tslib_fe->pageNotFoundAndExit (1676)
typo3conf/ext/realurl/class.tx_realurl.php - tx_realurl->decodeSpURL_throw404 (1368)
typo3conf/ext/realurl/class.tx_realurl.php - tx_realurl->decodeSpURL_settingPostVarSets (1176)
typo3conf/ext/realurl/class.tx_realurl.php - tx_realurl->decodeSpURL_doDecode (1021)
 - tx_realurl->decodeSpURL ()
t3lib/class.t3lib_div.php - ->call_user_func_array (4738)
typo3/sysext/cms/tslib/class.tslib_fe.php - t3lib_div->callUserFunction (563)
typo3/sysext/cms/tslib/index_ts.php - tslib_fe->checkAlternativeIdMethods (277)
index.php - ->require (78)

Actions #1

Updated by Dmitry Dulepov over 12 years ago

Note: you must user USER_FUNCTION as a pageNotFound_handling to reproduce this.

Add the following to the typo3conf/localconf.php:

$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = 'USER_FUNCTION:i_do_not_exist';

and request a non-existing page (for example, http://example.com/asdfjntgwertgqeg/). You will see the exception, if your settings allow that or a blank screen.

Agter the fix you should see a complain that i_do_not_exist was not prefixed with the ''user_''.

Actions #2

Updated by Mr. Hudson over 12 years ago

  • Status changed from New to Under Review

Patch set 1 of change I737c1b263ca53e9d23d3bd66498974b41c83df1d has been pushed to the review server.
It is available at http://review.typo3.org/6712

Actions #3

Updated by Mr. Hudson over 12 years ago

Patch set 2 of change I737c1b263ca53e9d23d3bd66498974b41c83df1d has been pushed to the review server.
It is available at http://review.typo3.org/6712

Actions #4

Updated by Mr. Hudson over 12 years ago

Patch set 3 of change I737c1b263ca53e9d23d3bd66498974b41c83df1d has been pushed to the review server.
It is available at http://review.typo3.org/6712

Actions #5

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change Ie49472eabd5d075b7199fb4df1e0c66f2361ede6 has been pushed to the review server.
It is available at http://review.typo3.org/6713

Actions #6

Updated by Mr. Jenkins over 12 years ago

Patch set 1 of change Ieb2ef07d4977ebceeee7e68c390f53f9646337b0 has been pushed to the review server.
It is available at http://review.typo3.org/6846

Actions #7

Updated by Xavier Perseguers over 12 years ago

  • Status changed from Under Review to Resolved
  • Assignee set to Dmitry Dulepov
  • % Done changed from 0 to 100
Actions #8

Updated by Xavier Perseguers about 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF