- Issue created by @rodetrev
This patch modifies the getPropertyDefinitions() method in Glossary.php to explicitly mark the $datasource parameter as nullable. This resolves the deprecation warning introduced in PHP 8.4 and Drupal 10.5.2.
With PHP 8.4 and Drupal 10.5.2
Deprecated: Drupal\search_api_glossary\Plugin\search_api\processor\Glossary::getPropertyDefinitions(): Implicitly marking parameter $datasource as nullable is deprecated, the explicit nullable type must be used instead in /app/docroot/modules/contrib/search_api_glossary/src/Plugin/search_api/processor/Glossary.php on line 46the explicit nullable type must be used instead
Change the line 46 in search_api_glossary/srcPlugin/search_api/processor/Glossary.php adding the explicit nullable type before the type DatasourceInterface.
from:
public function getPropertyDefinitions(DatasourceInterface $datasource = NULL) {
to:
public function getPropertyDefinitions(?DatasourceInterface $datasource = NULL) {
Active
4.2
Code
This patch modifies the getPropertyDefinitions() method in Glossary.php to explicitly mark the $datasource parameter as nullable. This resolves the deprecation warning introduced in PHP 8.4 and Drupal 10.5.2.