Query alter not working with latest version of search_api_solr

Created on 12 October 2023, 9 months ago
Updated 22 November 2023, 7 months ago

Problem/Motivation

The current searchstax release uses hook_search_api_solr_query_alter which was deprecated and removed in search_api_solr 4.3

https://www.drupal.org/project/search_api_solr/releases/4.3.0 β†’

- Removal of all deprecated hooks, use Events instead, including Solarium Events

This leads to broken code in some cases.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @neclimdul
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    Thanks for reporting this problem, and great job on the fix! The only problem here is that events were unfortunately introduced only pretty recently (in 4.2.3) in the Search API Solr module, so we cannot assume that everyone who is using this module also uses a version of Search API Solr that uses events. I think for the near term we should make sure to work both with hooks and events.
    The attached patch revision should ensure this. Please give it a try!

  • πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

    Makes sense. I don't know where the patch I wrote ended up but it was pretty similar we just put the logic from the function in the event which let it be cleaned up a little bit.

  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    I hid your patch since I find it less confusing if only the latest version of a patch is visible in the issue description. Just click β€œShow 2 more files” to see it.
    Anyways, did you test my patch and verify it also works for you?

  • Status changed to Fixed 7 months ago
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    Merged. Thanks again!

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

Production build 0.69.0 2024