powermail
powermail copied to clipboard
Export task in scheduler fails when triggered through CLI
Specs: TYPO3 11.5.16, powermail 10.4.3
When the powermail:export task is triggered through the play button in the backend, everything works fine. But when the cronjob triggers the scheduler execution, $GLOBALS['TYPO3_REQUEST'] is not set and it fails with an exception
Uncaught TYPO3 Exception Argument 1 passed to TYPO3\CMS\Core\Http\ApplicationType::fromRequest() must implement interface Psr\Http\Message\ServerRequestInterface, null given, called in /var/www/html/src/private/typo3conf/ext/powermail/Classes/Utility/BackendUtility.php on line 254
thrown in file /var/www/html/src/private/typo3/sysext/core/Classes/Http/ApplicationType.php
in line 62
Maybe this just needs an additional check via \TYPO3\CMS\Core\Core\Environment::isCli ? https://github.com/einpraegsam/powermail/blob/406110ac75b813729c97ef04e76f03e9ab1361fe/Classes/Utility/BackendUtility.php#L252