Daniel-KM / Omeka-S-module-SearchSolr

Search Omeka resources instantly and deeply with Apache Lucene / Solr
Other
3 stars 1 forks source link

Argument must be of type Countable|array in SolariumQuerier.php #16

Closed coret closed 1 month ago

coret commented 1 month ago

When searching I get the following error (may related to https://github.com/Daniel-KM/Omeka-S-module-AdvancedSearch/issues/14 ?):

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/http/goudatijdmachine.nl/omeka-s-modules/SearchSolr/src/Querier/SolariumQuerier.php:196
Stack trace:
#0 /home/http/goudatijdmachine.nl/omeka-s-modules/SearchSolr/src/Querier/SolariumQuerier.php(196): count()
#1 /home/http/goudatijdmachine.nl/omeka-s-modules/AdvancedSearch/src/Mvc/Controller/Plugin/SearchRequestToResponse.php(264): SearchSolr\Querier\SolariumQuerier->query()
#2 [internal function]: AdvancedSearch\Mvc\Controller\Plugin\SearchRequestToResponse->__invoke()
#3 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(275): call_user_func_array()
#4 /home/http/goudatijdmachine.nl/omeka-s-modules/AdvancedSearch/src/Controller/SearchController.php(154): Laminas\Mvc\Controller\AbstractController->__call()
#5 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): AdvancedSearch\Controller\SearchController->searchAction()
#6 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#7 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#8 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#9 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch()
#10 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#11 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners()
#12 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil()

#13 /home/http/goudatijdmachine.nl/omeka-s-4.1.1/index.php(21): Laminas\Mvc\Application->run()
#14 {main}

Commenting out the following code gets rid of the error and I get search results again (albeit without facets): https://github.com/Daniel-KM/Omeka-S-module-SearchSolr/blob/ec9b5e49bce9e49f64e70399750a7ace7c5b48b8/src/Querier/SolariumQuerier.php#L196-L213

FYI: Omeka S - version 4.1.1 Advanced Search - version 3.4.32 Advanced Search adapter for Solr - version 3.5.48

Daniel-KM commented 1 month ago

Ok, thanks.