Bug #79354
closed
PageRepository::getPage fails in Backend context
Added by Timo Hund almost 8 years ago.
Updated over 7 years ago.
Description
The call of PageRepository::getPage currently fails in the backend context with the following error:
Uncaught TYPO3 Exception
explode() expects parameter 2 to be string, null given
TypeError thrown in file
/var/www/dev-master.local.typo3.org/typo3_src/typo3/sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php in line 36.
This happens because FrontendGroupRestriction tries to read TSFE->gr_list. In TYPO3 7.6. is worked to call PageRepository::getPage in the backend context.
Is this a bug, or should a page be fetched in a different way?
- Status changed from New to Needs Feedback
why not initializing this setting? PageRepository is meant for the frontend so it expects certain things.
Hi. It would be great if it is possible to use getPages and getPagesOverlay also in backend context again. Maybe in sysext/core/Classes/Database/Query/Restriction/FrontendGroupRestriction.php the construct function add an if statement like
if (TYPO3_MODE == 'FE') {
$this->frontendGroupIds = $frontendGroupIds === null ? explode(',', $GLOBALS['TSFE']->gr_list) : $frontendGroupIds;
}
Kind Regards
- Has duplicate Bug #80917: Backend: Uncaught TYPO3 Exception in FrontendGroupRestriction constructor if $GLOBALS['TSFE']->gr_list is null added
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to Rejected
Wouter Wolters:
„https://review.typo3.org/#/c/49704/ the original change.
The revert https://review.typo3.org/#/c/49719/
So IMO the error must me solved in the code where the restriction is used wrongly.“
- Related to Bug #87125: FrontendGroupRestriction class explode-Error in constructor added
Also available in: Atom
PDF