Bug #78211
closedAbstractTreeView: Call to a member function isInWebMount() throwed FATAL
50%
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/
Updated by Wouter Wolters about 8 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?
Updated by Dave Najeel about 8 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
Updated by Wouter Wolters about 8 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.