Bug #91714
closedCached where clauses in PageRepository
100%
Description
There seems to be a problem with a runtime cache that was introduced with TYPO3 9.5.17 (and due to a bug became active in TYPO3 9.5.18).
- Original change in 9.5.17: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64355
- Bugfix in 9.5.18: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64513
In our client project, we hook into "enableFields" to add another constraint for "pages" and "tt_content" records. In 9.5.18 this stopped working for "pages" because the runtime cache doesn't account for varying values returned by this hook. The "where_hid_del" variable is only calculated once and then stored in the runtime cache.
We register the hook like this in ext_localconf.php:
call_user_func(function () { $hookClassName = \SMS\SitegeistNotingroup\Hooks\EnableColumns::class; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'][] = $hookClassName . '->addEnableColumns'; });
In the actual hook function, we use the frontend user aspect to check for the login state of the current user. Since PageRepository is probably used quite early, this aspect isn't fully initiated the first time the hook is called. In TYPO3 9.5.17 and below this worked out fine because the hook is evaluated every time, now it doesn't.
Feel free to contact me via Slack if you want to look into this. We have an extension with functional tests which could be used to debug this. Unfortunately I wasn't able to find a good solution yet.
Updated by Gerrit Code Review over 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65276
Updated by Gerrit Code Review about 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65276
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65604
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65641
Updated by Benni Mack about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 182e312920c6051617ce26b53322773bdf908c97.