backdrop-contrib / search_api

Provides a generic API for modules offering search capabilities
GNU General Public License v2.0
0 stars 5 forks source link

PHP Error: Too few arguments to function facetapi_get_plugins() when accessing facets tab #12

Closed earlyburg closed 3 years ago

earlyburg commented 3 years ago

After enabling search facets module accessing the "facets" tab at /admin/config/search/search_api/index/my_index/facets, a PHP error is returned with the following info:

ArgumentCountError: Too few arguments to function facetapi_get_plugins(), 2 passed in /modules/facetapi/plugins/adapter.inc on line 359 and exactly 3 expected in facetapi_get_plugins() (line 256 of /modules/facetapi/facetapi.module).

Which subsequently, crashes the page.

earlyburg commented 3 years ago

The function facetapi_get_plugins() is a clone of the function ctools_get_plugins(). https://api.drupal.org/api/ctools/includes%21plugins.inc/function/ctools_get_plugins/7.x-1.x the original function takes two params with one optional param the changed function (facetapi_get_plugins()) takes three. Unfortunately the new function is used in the context of the old one in the code, with the third value being optional so this breaks the page. https://github.com/backdrop-contrib/facetapi/blob/1.x-1.x/facetapi.module -- line 256

docwilmot commented 3 years ago

Isn't this a Facet API module error?

earlyburg commented 3 years ago

@docwilmot Yes, that is correct.

earlyburg commented 3 years ago

@docwilmot (update) I've been working on facetapi since yesterday. I think I understand where you left off, why, and what we are trying to do, and I feel we are really close. I'm eventually going to push my work up to my github/earlyburg/facetapi branch when I get it completely working.

earlyburg commented 3 years ago

This has been fixed by merged pull request here: https://github.com/backdrop-contrib/facetapi/pull/4 Closing this issue.