ElasticPress icon indicating copy to clipboard operation
ElasticPress copied to clipboard

Fixed PHP autosuggest placeholder is not being used.

Open fabianmarz opened this issue 5 years ago • 2 comments

Description of the Change

  • While the autosuggest search string placeholder value can be changed via a PHP hook, it's not picked up by the autosuggest JS and therefore the query will break or doesn't deliver the correct results.

Alternate Designs

  • Instead of deleting const placeholder = 'ep_autosuggest_placeholder'; I considered using const placeholder = queryJSON.placeholder; but decided to drop the line completely as the placeholder is used in buildSearchQuery() only.

Benefits

  • Don't break any the results if other than the default value is used :)

Possible Drawbacks

  • X

Verification Process

  • Inspected the query after the search and replace was done to ensure the query runs with the actual search term.

Checklist:

  • [x] I have read the CONTRIBUTING document.
  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have added tests to cover my change.
  • [ ] All new and existing tests passed.

Applicable Issues

  • Didn't find any.

Changelog Entry

fabianmarz avatar Jan 10 '20 12:01 fabianmarz

@mustafauysal can you review this one?

tlovett1 avatar Mar 10 '20 14:03 tlovett1

@tlovett1 looks good to me 👍

mustafauysal avatar Mar 11 '20 08:03 mustafauysal