I have just upgraded to version 2.1.2 of Omeka-s (while waiting for the future V3) and I took the opportunity to upgrade the modules we use, in particular “Search 3.5.15” and “SearchSolr 3.5.15”. The latter is based on the Solarium library, which I installed under the SearchSolr directory.
I was able to install both modules. But when I want to configure SearchSolr, I get the following error:
Argument 1 passed to Solarium\Core\Client\Client::__construct() must be an instance of Solarium\Core\Client\Adapter\AdapterInterface, array given, called in /applis/omeka/home/www/omeka-s/modules/SearchSolr/src/Api/Representation/SolrCoreRepresentation.php on line 137
Détails :
TypeError: Argument 1 passed to Solarium\Core\Client\Client::__construct() must be an instance of Solarium\Core\Client\Adapter\AdapterInterface, array given, called in /applis/omeka/home/www/omeka-s/modules/SearchSolr/src/Api/Representation/SolrCoreRepresentation.php on line 137 and defined in /applis/omeka/home/www/omeka-s/modules/SearchSolr/vendor/solarium/solarium/src/Core/Client/Client.php:270
Hi,
The point to use the Solarium library is to avoid the php-solr extension, that is not always installed on servers and that is often late to integrate new improvements of solr.
The release includes it, but if you use it, it is installed via composer install command.
So it seems that you installed Solarium version 6, but the module still requires version 5 of the library. So remove the directory vendor and don’t use composer update.
So it’s strange. The version is in the file vendor/solarium/solarium/src/Client.php, but normally, it is the same than the composer one. Else, the zipped release contains a version with it.