diff --git a/Classes/Common/Solr.php b/Classes/Common/Solr.php index f73a8297..20274858 100644 --- a/Classes/Common/Solr.php +++ b/Classes/Common/Solr.php @@ -624,13 +624,15 @@ class Solr $this->loadSolrConnectionInfo(); // Configure connection adapter. $adapter = GeneralUtility::makeInstance(\Solarium\Core\Client\Adapter\Http::class); - $adapter->setTimeout($this->config['timeout']); + // Todo: When updating to TYPO3 >=10.x and Solarium >=6.x + // the timeout must be set with the adapter instead of the + // endpoint (see below). + // $adapter->setTimeout($this->config['timeout']); // Configure event dispatcher. // Todo: When updating to TYPO3 >=10.x and Solarium >=6.x // we have to provide an PSR-14 Event Dispatcher instead of // "null". // $eventDispatcher = GeneralUtility::makeInstance(\TYPO3\CMS\Core\EventDispatcher\EventDispatcher::class); - $eventDispatcher = null; // Configure endpoint. $config = [ 'endpoint' => [ @@ -641,12 +643,18 @@ class Solr 'path' => '/' . $this->config['path'], 'core' => $core, 'username' => $this->config['username'], - 'password' => $this->config['password'] + 'password' => $this->config['password'], + 'timeout' => $this->config['timeout'] // Remove when upgrading to Solarium 6.x ] ] ]; // Instantiate Solarium\Client class. - $this->service = GeneralUtility::makeInstance(\Solarium\Client::class, $adapter, $eventDispatcher, $config); + $this->service = GeneralUtility::makeInstance(\Solarium\Client::class, $config); + $this->service->setAdapter($adapter); + // Todo: When updating to TYPO3 >=10.x and Solarium >=6.x + // $adapter and $eventDispatcher are mandatory arguments + // of the \Solarium\Client constructor. + // $this->service = GeneralUtility::makeInstance(\Solarium\Client::class, $adapter, $eventDispatcher, $config); // Check if connection is established. $query = $this->service->createCoreAdmin(); $action = $query->createStatus(); diff --git a/Resources/Private/Language/Labels.xml b/Resources/Private/Language/Labels.xml index 7168d4cd..54a2cdb0 100644 --- a/Resources/Private/Language/Labels.xml +++ b/Resources/Private/Language/Labels.xml @@ -193,7 +193,7 @@ - + @@ -378,7 +378,7 @@ - + diff --git a/composer.json b/composer.json index 8db89093..144512c1 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "typo3/cms-core": "~8.7.32|~9.5.17", "typo3/cms-tstemplate": "~8.7.32|~9.5.17", "ubl/php-iiif-prezi-reader": "0.3.0", - "solarium/solarium": "^5.2" + "solarium/solarium": "^4.2|^5.2" }, "replace": { "typo3-ter/dlf": "self.version"