Task #54813

BackendConfigurationManager figures out wrong pid

Added by Felix Oertel almost 6 years ago. Updated about 1 year ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Extbase
Start date:
2014-01-07
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

For backend modules, in Configuration/BackendConfigurationManager.php:getCurrentPageId() we try to find the current pid. If we are in Web->, the id is readable via _GP('id'), everything is fine.

If we are outside Web->, there is no pid. The manager then tries to figure some useful pid out. It first looks for a page markes "is_siteroot" and then a sys_template marked "root". While the treeroot is id 0, the manager will usually use id 1, because this is, where the root template resides.

This causes problems with caching, because the core takes id 0 for "global" scope. For example the caches in "cf_cache_pagesection" are generated (and tagged) for pid 0, if no specific pid is given.

While the method is currently protected and I don't think too much people will have their configurationManager inherited, this still would be a breaking change. It's a bug, so breaking change would be ok, but some people mind find, it's not quiet the right time for that.

If that would be the case, I would propose deprecating this method and introducing a new one to deal with the pid correctly.


Related issues

Related to TYPO3 Core - Bug #55028: Static TS must be available even when there is no page UID Closed 2014-01-15
Related to TYPO3 Core - Task #54701: Cache global TypoScript template in backend Closed 2014-01-02
Related to TYPO3 Core - Task #86262: Deprecate FE TypoScript processing in BE Rejected 2018-09-15

Associated revisions

Revision ba2386e7 (diff)
Added by Felix Oertel almost 6 years ago

[BUGFIX] Assume pid 0 for global backend context

If outside from "Web", extbase modules try to figure out some pid,
while in reality there is just none. The core takes "0" in this
situations, for looking for typoscript templates and tagging
cf_cache_pagesection entries.

To enable extbase to use the core's cache entries, we should streamline
this.

  • Return 0, if no pid is set
  • Remove needless unit-tests

Resolves: #54813
Releases: 6.2
Change-Id: I58cbaac0b40323e1766229488973b775accd1b97
Reviewed-on: https://review.typo3.org/26675
Reviewed-by: Oliver Klee
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring

History

#1 Updated by Ernesto Baschny almost 6 years ago

Felix, go ahead and change that, if it's wrong. This is internal and not API, so I doubt that extensions are extending it.

I don't understand what you mean with "While the treeroot is id 0, the manager will usually use id 1, because this is, where the root template resides". Maybe a patch in Gerrit will help us understand how you suggest to solve the problem.

Thanks for working on that!

#2 Updated by Felix Oertel almost 6 years ago

Hey Ernesto,

if we call a backend module outside "Web", it does not have a page selected. The core then assumes the pid "0", for example to look for typoscript templates or to tag the caches (cf_cache_pagesection e.g.).

Extbase instead looks for the first page with "Use as Root Page" set and, if there is none, for the page where the first typoscript template with "Rootlevel" set and takes that pid.

While I understand that intention, I don't think that makes any sense, because if no page is selected, it might be as wrong to take the first root-page / -template as it might to take the last one or any other page.

I would go for the cores approach ... if the pid is set, good, if not, use 0.

#3 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from Accepted 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/26675

#4 Updated by Gerrit Code Review almost 6 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/26675

#5 Updated by Anonymous almost 6 years ago

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

#7 Updated by Marc Bastian Heinrichs almost 6 years ago

  • Status changed from Resolved to On Hold
  • % Done changed from 100 to 0

#8 Updated by Ernesto Baschny almost 6 years ago

+1 on reverting that for now, thanks Ma-Ba for taking over. Let's think about better ways to achieve the desired result first.

#9 Updated by Ernesto Baschny over 5 years ago

  • Project changed from Extbase MVC Framework to TYPO3 Core
  • Category deleted (Extbase: Configuration)

#10 Updated by Ernesto Baschny over 5 years ago

  • Category set to Extbase
  • Is Regression set to No
  • TYPO3 Version set to 6.2

#11 Updated by Ernesto Baschny over 5 years ago

  • Parent task set to #55079

#12 Updated by Alexander Opitz over 4 years ago

  • Status changed from On Hold to New
  • Target version changed from 6.2.0 to 7 LTS

Remove OnHold and retarget for 7 ... it's to late for 6.2 (if it is breaking).

#13 Updated by Benni Mack about 4 years ago

  • Target version changed from 7 LTS to 8 LTS

#14 Updated by Benni Mack over 2 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel

#15 Updated by Susanne Moog about 2 years ago

  • Blocks deleted (Task #54701: Cache global TypoScript template in backend)

#16 Updated by Susanne Moog about 2 years ago

  • Related to Task #54701: Cache global TypoScript template in backend added

#17 Updated by Benni Mack almost 2 years ago

  • Assignee deleted (Felix Oertel)
  • Target version changed from Candidate for patchlevel to Candidate for Major Version
  • Parent task deleted (#55079)

#18 Updated by Christian Kuhn about 1 year ago

  • Related to Task #86262: Deprecate FE TypoScript processing in BE added

#19 Updated by Gerrit Code Review about 1 year 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/58284

#20 Updated by Gerrit Code Review about 1 year 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/58284

#21 Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#22 Updated by Gerrit Code Review about 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#23 Updated by Gerrit Code Review about 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#24 Updated by Gerrit Code Review about 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#25 Updated by Gerrit Code Review about 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#26 Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#27 Updated by Gerrit Code Review about 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#28 Updated by Gerrit Code Review about 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#29 Updated by Gerrit Code Review about 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#30 Updated by Gerrit Code Review about 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#31 Updated by Gerrit Code Review about 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#32 Updated by Gerrit Code Review about 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#33 Updated by Gerrit Code Review about 1 year ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#34 Updated by Gerrit Code Review about 1 year ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#35 Updated by Gerrit Code Review about 1 year ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58284

#36 Updated by Christian Kuhn about 1 year ago

  • Status changed from Under Review to New

Also available in: Atom PDF