Skip to content

Commit 6342da2

Browse files
committed
[TASK] Avoid TSFE in Workspaces chapter
TSFE has been deprecated with TYPO3 v13 and will be removed with TYPO3 v14. Therefore, this mentioning has to be dropped. `TSFE->sys_page` holds an instance of the `PageRepository`, therefore this is a suitable substitution. Related: TYPO3-Documentation/Changelog-To-Doc#1074 Releases: main, 13.4
1 parent 45c4514 commit 6342da2

File tree

1 file changed

+6
-2
lines changed
  • Documentation/ApiOverview/Workspaces

1 file changed

+6
-2
lines changed

Documentation/ApiOverview/Workspaces/Index.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ frontend:
129129

130130
.. rst-class:: dl-parameters
131131

132-
$GLOBALS['TSFE']->sys\_page->versionOL($table, &$row, $unsetMovePointers=FALSE)
132+
\\TYPO3\\CMS\\Core\\Domain\\Repository\\PageRepository->versionOL($table, &$row, $unsetMovePointers=FALSE)
133133
Versioning Preview Overlay.
134134

135135
Generally ALWAYS used when records are selected based on uid or pid.
@@ -148,9 +148,13 @@ $GLOBALS['TSFE']->sys\_page->versionOL($table, &$row, $unsetMovePointers=FALSE)
148148
.. code-block:: php
149149
:caption: EXT:some_extension/Classes/SomeClass.php
150150
151+
// use TYPO3\CMS\Core\Domain\Repository\PageRepository;
152+
// use TYPO3\CMS\Core\Utility\GeneralUtility;
153+
154+
$pageRepository = GeneralUtility::makeInstance(PageRepository);
151155
$result = $queryBuilder->executeQuery();
152156
while ($row = $result->fetchAssociative()) {
153-
$GLOBALS['TSFE']->sys_page->versionOL($table,$row);
157+
$pageRepository->versionOL($table, $row);
154158
if (is_array($row)) {
155159
// ...
156160
}

0 commit comments

Comments
 (0)