Project

General

Profile

Actions

Bug #91714

closed

Cached where clauses in PageRepository

Added by Simon Praetorius almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Start date:
2020-06-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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).

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.

Actions #1

Updated by Gerrit Code Review over 3 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

Actions #2

Updated by Gerrit Code Review over 3 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

Actions #3

Updated by Gerrit Code Review over 3 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

Actions #4

Updated by Gerrit Code Review over 3 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

Actions #5

Updated by Benni Mack over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF