Actions
Bug #79013
closedUsing PageTreeView without logged in BE_USER throws error
Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-12-16
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
In the TYPO3\CMS\Backend\Tree\View\AbstractTreeView on line 765 is an if statement which checks if the page isInWebMount of the logged in Backend User but there is no check if there is a backend user object at all. I am using the PageTreeView to get all pages in a UserFunc and generate a "Random Menu" where always 5 random pages are returned to the TMENU. When i am not logged in to the backend it throws an Error: "Fatal error: Call to a member function isInWebMount() on null in /websites/typo3/instance/vendor/typo3/cms/typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php on line 765" so i changed:
if (!$this->getBackendUser()->isInWebMount($pageUid)) { // Current record is not within web mount => skip it continue; }
to
if (!empty($this->getBackendUser()) && !$this->getBackendUser()->isInWebMount($pageUid)) { // Current record is not within web mount => skip it continue; }
To check if there is a backend user before calling the isInWebMount().
Is there anything i missed?
Actions