backdrop-contrib / search_api

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

Error: Call to undefined method SearchApiViewsQuery::placeholder() #32

Closed laryn closed 2 years ago

laryn commented 2 years ago

Error: Call to undefined method SearchApiViewsQuery::placeholder() in views_handler->placeholder() (line 493 of /app/core/modules/views/includes/handlers.inc).

I'm testing with a basic exposed "combine fields filter" and getting this error.

earlyburg commented 2 years ago

Please feel free to submit a pull request. I will do what I can.

earlyburg commented 2 years ago

Please feel free to submit a pull request. I will do what I can.

Dang. The function is just not there. Odd that this did not come up before - going to instanciate it and do a new version

earlyburg commented 2 years ago

From my analysis, I am not seeing any reason for the method. I had a look at the Drupal 7 version of the module and it's not in there either. I can throw the method into the code and have it return NULL or TRUE or something but I would much rather figure out which views handler is having the issue and figure out what it needs. To that end, we will need to test. To test we will need to reproduce the error. @laryn - here is the culprit

  /**
   * Provides a unique placeholders for handlers.
   */
  function placeholder() {
    return $this->query->placeholder($this->options['table'] . '_' . $this->options['field']);
  }

Do we actually need this function?

laryn commented 2 years ago

@earlyburg Do you get an error without it if you're using a "Combine fields" exposed filter in a view?

laryn commented 2 years ago

I'm starting fresh and I'll see if this error comes up again. If so I'll reopen.

earlyburg commented 2 years ago

I don't really use views that much any more. They are difficult to style and keep updated. As a dev it usually takes me less time to programmaticly build content from scratch than try to make a generic solution be specific. Subsequently I don't know the answer to the question. Apologies.