Przeglądaj źródła

bugfix 'Call to a member function getConnectionForTable() on null'

Olivier Massot 4 lat temu
rodzic
commit
e2be469676

+ 3 - 1
ot_connect/Classes/Service/OtAuthenticationService.php

@@ -8,6 +8,7 @@ use GuzzleHttp\Cookie\SetCookie;
 use GuzzleHttp\Exception\GuzzleException;
 use GuzzleHttp\Exception\RequestException;
 use TYPO3\CMS\Core\Crypto\Random;
+use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\TimeTracker\TimeTracker;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use \TYPO3\CMS\Core\Authentication\AbstractAuthenticationService;
@@ -87,7 +88,7 @@ class OtAuthenticationService extends AbstractAuthenticationService
      */
     private $connectionPool;
 
-    public function injectConnectionPool(\TYPO3\CMS\Core\Database\ConnectionPool $connectionPool)
+    public function injectConnectionPool(ConnectionPool $connectionPool)
     {
         $this->connectionPool = $connectionPool;
     }
@@ -98,6 +99,7 @@ class OtAuthenticationService extends AbstractAuthenticationService
     public function __construct() {
         $this->jar = new CookieJar;
         $this->client = new Client(['base_uri' => self::DOMAIN, 'cookies' => $this->jar]);
+        $this->connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
     }
 
     /**