Problem/Motivation

Getting warnings about:

The deprecated alter hook hook_search_api_query_alter() is implemented in these functions: facets_search_api_query_alter, facets_summary_search_api_query_alter. This hook is deprecated in search_api:8.x-1.14 and is removed from search_api:2.0.0. Please use the "search_api.query_pre_execute" event instead. See https://www.drupal.org/node/3059866

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

heddn created an issue. See original summary.

karlshea’s picture

Status: Active » Needs review
StatusFileSize
new8.92 KB
karlshea’s picture

StatusFileSize
new8.88 KB

Oops PHP 7.3!

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

This looks great and it seems like all tests still pass.If this wasn't going to work I guess all (integration) tests would be broken ;)

Would love another review to confirm, but moving to rtbc in the meantime.

heddn’s picture

+1 from me.

borisson_’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Patch seems to have conflicted with something else that I committed today.

karlshea’s picture

Status: Needs work » Needs review
StatusFileSize
new9.09 KB

Conflict in the services yaml.

karlshea’s picture

Issue tags: -Needs reroll

  • borisson_ committed c250c2f on 8.x-1.x authored by KarlShea
    Issue #3198193 by KarlShea: Deprecated hook_search_api_query_alter
    
borisson_’s picture

Status: Needs review » Fixed

Committed and pushed, thanks.

mkalkbrenner’s picture

After this commit I can't "install from existing config" anymore:

 [error]  Error: Class 'Drupal\search_api\Event\SearchApiEvents' not found in Drupal\facets\EventSubscriber\SearchApiSubscriber::getSubscribedEvents() (line 53 of /var/www/html/web/modules/contrib/facets/src/EventSubscriber/SearchApiSubscriber.php) #0 /var/www/html/web/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterEventSubscribersPass.php(37): Drupal\facets\EventSubscriber\SearchApiSubscriber::getSubscribedEvents()

Drupal 9.1

karlshea’s picture

Is search_api installed at that point? If it can't find the class that seems like a composer autoloader issue, there's a use Drupal\search_api\Event\SearchApiEvents at the top of SearchApiSubscriber.

Could it be that facets requires search_api in require-dev instead of require?

karlshea’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.