Problem/Motivation

Search api is throwing a error message on empty facet parameter on url. This is the error message:
Warning: Invalid argument supplied for foreach() in search_api_form_views_exposed_form_alter() (line 757 of modules/contrib/search_api/search_api.module).

Steps to reproduce

On a search api view, add on the url ?f or ?f= parameter.

Proposed resolution

Do not loop over "f"parameter if is not an array

Remaining tasks

patch and review

CommentFileSizeAuthor
#2 search_api-3169531-2.patch1000 bytesakalam

Comments

akalam created an issue. See original summary.

akalam’s picture

StatusFileSize
new1000 bytes
akalam’s picture

Status: Active » Needs review
drunken monkey’s picture

Status: Needs review » Fixed

Makes sense, thanks a lot for reporting and providing a patch!
Tested, and it does what it says on the cover. Just adjusted the comment a bit and then committed.
Thanks again!

  • drunken monkey committed b0bfce4 on 8.x-1.x authored by akalam
    Issue #3169531 by akalam, drunken monkey: Fixed warning when non-array "...

Status: Fixed » Closed (fixed)

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