Changes concerning TYPO3_MODE rolled back.

Checking whether you are in backend or frontend mode requires the request as of version 12.
This cannot be achieved with major changes at the moment.
This commit is contained in:
Christopher Timm 2023-03-20 22:22:43 +01:00
parent 519dabb42b
commit 66a247728c
1 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,6 @@ use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Core\Http\ApplicationType;
/**
* Helper class for the 'dlf' extension
@ -793,8 +792,8 @@ class Helper
*/
public static function whereExpression($table, $showHidden = false)
{
// TODO: Request should be handed over instead of using $GLOBALS['TYPO3_REQUEST']
if (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
// TODO: Check with applicationType; TYPO3_MODE is removed in v12
if (\TYPO3_MODE === 'FE') {
// Should we ignore the record's hidden flag?
$ignoreHide = 0;
if ($showHidden) {
@ -809,7 +808,8 @@ class Helper
} else {
return '';
}
} elseif (ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
// TODO: Check with applicationType; TYPO3_MODE is removed in v12
} elseif (\TYPO3_MODE === 'BE') {
return GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable($table)
->expr()