Bug #92369
closedPageRepository "getPage" excludes system folders
0%
Description
(Please excuse if any of this is filled out wrong - I'm a bug tracker n00b)
As of v9.5, the "getPage" method excludes system folders because of this line (https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/frontend/Classes/Page/PageRepository.php#L275).
$expressionBuilder->lt('pages.doktype', 200)
which equates to
(`pages`.`doktype` < 200)
The sys folder ID is 254.
I appreciate the reasoning behind this, as you don't typically want to give access, however we rely on this function inside of one of our Scheduler tasks, which uses System folders to hold records (via the TSFE fetch_the_id
method.
I have temporarily patched this locally by doing the following (but understand this isn't the best way of fixing it).
$expressionBuilder->orX(
$expressionBuilder->lt('pages.doktype', 200),
$expressionBuilder->eq('pages.doktype', DOKTYPE_SYSFOLDER)
)
This was discovered upgrading from 8.7 to 9.5
Updated by Oliver Bartsch about 4 years ago
- Status changed from New to Needs Feedback
Hi,
you said that you use this function in a scheduler task which typically has no frontend context. As the PageRepository is mainly used in the frontend - handling language overlays and suff - this is maybe not the correct function to use in this case. Have you thought about using BackendUtility::getRecord() or the QueryBuilder directly instead?
Updated by Mike Street about 4 years ago
Ah yes, apologies. I was also rather hasty in filing this as it has undesired consequences on the front-end.
Updated by Oliver Bartsch about 4 years ago
- Status changed from Needs Feedback to Closed
No Problem, thanks for your feedback. As it seems to be resolved for you, I will close this issue for now. If you feel there is still something not working, please let me know and I'll re-open the issue.