Project

General

Profile

Actions

Bug #78211

closed

AbstractTreeView: Call to a member function isInWebMount() throwed FATAL

Added by Dave Najeel over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2016-10-09
Due date:
% Done:

50%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
AbstractTreeView
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:

Description

Hey,

i had used the code Example from:
https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Examples/PageTrees/Index.html

At the first time, all was fine.
But After logout from the Backend, the Controller Throwed a FATAL error.

Fatal error: Call to a member function isInWebMount() on a non-object in /var/www/paramize/typo3_episch/vendor/typo3/cms/typo3/sysext/backend/Classes/Tree/View/+AbstractTreeView.php on line 756+

  while ($crazyRecursionLimiter > 0 && ($row = $this->getDataNext($res))) {
            $pageUid = ($this->table === 'pages') ? $row['uid'] : $row['pid'];
            if (!$this->getBackendUser()->isInWebMount($pageUid)) {
                // Current record is not within web mount => skip it
                continue;
            }

The Fix is maybe:

  while ($crazyRecursionLimiter > 0 && ($row = $this->getDataNext($res))) {
            $pageUid = ($this->table === 'pages') ? $row['uid'] : $row['pid'];
            // only add $GLOBALS['BE_USER'] != NULL &&
            if ($GLOBALS['BE_USER'] != NULL && !$this->getBackendUser()->isInWebMount($pageUid)) {
                // Current record is not within web mount => skip it
                continue;
            }

The Problem exist in older Versions, too:
https://forum.typo3.org/index.php/t/204838/


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #79013: Using PageTreeView without logged in BE_USER throws errorRejected2016-12-16

Actions
Actions #1

Updated by Dave Najeel over 7 years ago

  • % Done changed from 100 to 50
Actions #2

Updated by Wouter Wolters over 7 years ago

  • Status changed from New to Needs Feedback

Do you have an example extension that can show how you implemented your code? After logout this code should not be triggered...
Do you maybe use this code in the frontend?

Actions #3

Updated by Dave Najeel over 7 years ago

Wouter Wolters wrote:

Do you have an example extension that can show how you implemented your code? After logout this code should not be triggered...
Do you maybe use this code in the frontend?

its an extension with a 1 to 1 copy paste of this example https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Examples/PageTrees/Index.html as Frontend Controller.
Yes if you logout the error doesn't appear immediately, you have to wait until the cache generating new or you add the param &no_cache=1

Actions #4

Updated by Wouter Wolters over 7 years ago

  • Status changed from Needs Feedback to Rejected

The pagetree is not meant for frontend usage. The BE_USER does not exist there. This example only works in backend context of TYPO3.
There is no API in TYPO3 for the pagetree in the frontend.

I have to reject this bug report because the code can't work in the frontend.

Actions

Also available in: Atom PDF