Problem/Motivation
Fetching keys and conjunction now creates a few problems.

Error: Cannot unset string offsets in search_overrides_search_api_solr_query_alter() (line 33 of modules/contrib/search_overrides/search_overrides.module).

Also the keys should be an array. I'm not sure if this used to work in previous versions of the module, I just started using it.

Proposed resolution
Use corrects methods on query to get the keys and conjunction.

  $query_keys = explode(' ', $query->getKeys());
  $conjunction = $query->getParseMode()->getConjunction();

Remaining tasks
Create patch.

Comments

bceyssens created an issue. See original summary.

bceyssens’s picture

Status: Active » Needs review
StatusFileSize
new588 bytes
mandclu’s picture

Assigned: Unassigned » mandclu
Status: Needs review » Needs work

It seems as thought the only time $query->getKeys() doesn't return an array is when the view's parse mode is set to direct query. Otherwise, it does. So actually, the code needs to be able to handle both. I'll update the patch.

mandclu’s picture

Assigned: mandclu » Unassigned
Status: Needs work » Needs review
StatusFileSize
new900 bytes

OK the attached works for me in a variety of parse modes. Let me know if this works for you.

  • mandclu committed 0e6e05e on 8.x-1.x
    Issue #3145633 by bceyssens, mandclu: Cannot unset string offsets in...
mandclu’s picture

Status: Needs review » Fixed

I decided I wanted to get this merged in before starting some other work, so this has been committed. Feel free to reopen the issue if more work is needed on this.

Status: Fixed » Closed (fixed)

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