Commit aceb5ccc authored by Kevin Ditscheid's avatar Kevin Ditscheid

[BUGFIX] Fix the Licensing service to work without second parameter

parent 1a04da20
......@@ -30,6 +30,7 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use SGalinski\SgRoutes\Utility\ExtensionUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Http\NullResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -104,13 +105,16 @@ class LicensingService {
* @return ResponseInterface
* @throws \InvalidArgumentException
*/
public function ajaxPing(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface {
public function ajaxPing(ServerRequestInterface $request, ResponseInterface $response = NULL): ResponseInterface {
/** @var BackendUserAuthentication $backendUser */
$backendUser = $GLOBALS['BE_USER'];
if ($backendUser && !$backendUser->getModuleData('tools_beuser/index.php/web_SgRoutesRoute_pinged', 'ses')) {
$backendUser->pushModuleData('tools_beuser/index.php/web_SgRoutesRoute_pinged', TRUE);
self::ping();
}
if ($response === NULL) {
$response = new NullResponse();
}
return $response;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment