Feature #93789
openProvide a reliable method to determine page id in the Backend mode
0%
Description
Currently there is no public API to get the current page id in the Backend mode. Such API can be useful for hooks that behave differently depending on where they are executed in the page tree. For example, we have a part of the tree where certain operations are restricted additionally to the TYPO3 permissions and we have other parts of the tree where only certain records are allowed, or yet other parts of the tree where we automatically move records to proper places if the editor accidentally creates them in a wrong folder.
Unfortunately the only current solution provided by TYPO3 is a condition that we could use in Page TSConfig but that condition does not work reliably because the implementation there is incomplete. Also we really need to get current page id there, not just whether we are in some part of tree or not. TYPO3 does not provide such public API, so we had to develop our own.
The current TYPO3 code for determining page id is located at EXT:backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php
but it is private and does not cover all possible cases.
The idea is to implement a new method in the BackendUtility
with the following signature:
/** * Determines the current page id while in the Backend context. Behavior * in the Frontend context is undefined. * * @return int Page id or zero if it cannot be determined */ public static function getCurrentPageId(): int { }
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/+/68525
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/+/68525
Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/68525
Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/68525
Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/68525
Updated by Gerrit Code Review over 3 years 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/c/Packages/TYPO3.CMS/+/68525
Updated by Dmitry Dulepov over 3 years ago
Code is abandoned:
- Got a comment: "We do not want this"
- phpstan gives false failures
Not worth spending more time in this case. If anybody needs the code, you can find it there.
Updated by Martin Kutschker over 3 years ago
There was only one commentor that was unhappy with the implementation not the feature.
Updated by Benni Mack over 3 years ago
- Target version changed from 11.3 to 11.4
Updated by Benni Mack about 3 years ago
- Target version changed from 11.4 to 12 LTS
Updated by Benni Mack over 1 year ago
- Target version changed from 12 LTS to Candidate for Major Version