Bug #87540

cache_treelist does not take BE users into account

Added by Philipp Thiele 12 months ago. Updated 28 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2019-01-24
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

cache_treelist table caches the tree for the current user. If the user is anonymous, fetching cached tree for logged in backend users will skip pages allowed for those users. If the backend user was logged in when cache was created, anonymous users will get a list of pages accessible to that user (basically: hidden pages are added to cache_treelist).
exspecially confusing when using \TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor and use preview of hidden page.

Example TS:

tt_content {
    nestedContentElement {
        templateName = NestedContentElement 
        dataProcessing {
            10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
            10 {
                table = tx_extensionname_domain_model_nestedcontent
                pidInList = 1
                languageField = sys_language_uid
                where.data = field:uid
                where.wrap = contentelement=|
                recursive = 99
                orderBy = sorting
                as = nestedContent
            }
        }
    }
}

Reproducable in TYPO3 8.7 & 9.5
related to / very much the same as #22236 issued with frontend users


Related issues

Related to TYPO3 Core - Bug #22236: cache_treelist does not take FE users into account Closed 2010-03-04

Associated revisions

Revision a08c6b09 (diff)
Added by Benni Mack 2 months ago

[BUGFIX] Do not add entries to cache_treelist when logged into BE

When accessing cache_treelist / cObj->getTreeList()
this information should not be cached at all when logged
into the backend at the same time. This would then result
in wrong lists of IDs.

As treelist is conceptually wrong on a various number of levels,
a short workaround is added so the cache is never written
when accessing the Frontend and having a valid $GLOBALS['BE_USER']
object.

Resolves: #87540
Releases: master, 9.5
Change-Id: I1a2f0da3fffd7790dcf1988c76f6fc68899241d4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62172
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Tested-by: Daniel Gorges <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Bartsch <>
Reviewed-by: Frank N├Ągler <>
Reviewed-by: Guido Schmechel <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Daniel Gorges <>
Reviewed-by: Benni Mack <>

Revision f16f9859 (diff)
Added by Benni Mack 2 months ago

[BUGFIX] Do not add entries to cache_treelist when logged into BE

When accessing cache_treelist / cObj->getTreeList()
this information should not be cached at all when logged
into the backend at the same time. This would then result
in wrong lists of IDs.

As treelist is conceptually wrong on a various number of levels,
a short workaround is added so the cache is never written
when accessing the Frontend and having a valid $GLOBALS['BE_USER']
object.

Resolves: #87540
Releases: master, 9.5
Change-Id: I1a2f0da3fffd7790dcf1988c76f6fc68899241d4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62284
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Philipp Thiele 12 months ago

  • Related to Bug #22236: cache_treelist does not take FE users into account added

#2 Updated by Gerrit Code Review 3 months 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/+/62172

#3 Updated by Benni Mack 2 months ago

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

#4 Updated by Gerrit Code Review 2 months ago

  • Status changed from Resolved to Under Review

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/+/62284

#5 Updated by Gerrit Code Review 2 months ago

Patch set 2 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/+/62284

#6 Updated by Benni Mack 2 months ago

  • Status changed from Under Review to Resolved

#7 Updated by Benni Mack 28 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF