[TASK] Consolidate hooks in workspace preview 66/55866/2
authorBenni Mack <benni@typo3.org>
Thu, 22 Feb 2018 20:00:27 +0000 (21:00 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 23 Feb 2018 11:22:38 +0000 (12:22 +0100)
commit109e8dc10313e6127c2241cceef9a6f34e4720a2
tree822c7d53e1c2cdc86d86d606937e9a6897d2ce4e
parentcbbf4aa5a674f5e8332e07a8d5953139816a1d55
[TASK] Consolidate hooks in workspace preview

The Workspace preview hooks first hook into TSFE->connectToDB
to see if ADMCMD_prev is set via GP/cookie. If so, the TSFE object gets
re-instantiated, which is utterly unnecessary.

Additionally, it unsets the BE user cookie, solely to use a SECOND hook
(initializePreviewUser()) to check if the BE_USER is null.

Instead, the hooks are consolidated and the one hook after a regular BE user
exists, gets used, and overridden by a custom BE user object as defined
in the preview configuration with the workspace preview.

Resolves: #84014
Releases: master
Change-Id: Id3caf9cd99ff13c906062ff95523f6066d90d322
Reviewed-on: https://review.typo3.org/55866
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/workspaces/Classes/Hook/PreviewHook.php
typo3/sysext/workspaces/ext_localconf.php