Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Escape special characters setting no longer working in 2.7.x #1605

Closed
fiver-watson opened this issue Jun 2, 2023 · 1 comment · Fixed by #1660
Closed

Regression: Escape special characters setting no longer working in 2.7.x #1605

fiver-watson opened this issue Jun 2, 2023 · 1 comment · Fixed by #1660
Assignees
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Milestone

Comments

@fiver-watson
Copy link
Contributor

Current Behavior

This issue was first reported in the user forum 2023-03 but not confirmed at the time to be a 2.7 issue. Recently re-reported by another user upgrading from 2.4 (where the setting worked), and reproducible in the public demo site (now running 2.7.1-v192). Forum thread:

Steps to reproduce the behavior

  • Login as an administrator
  • Create a description that includes a slash - e.g. coffee/tea.
  • Perform a search for coffee/tea: this should produce an Elasticsearch exception
  • Navigate to Admin > Settings > Global, and find the "Escape special chars from searches" setting
  • Add / to this setting's input and Save
  • Perform the global search for coffee/tea again

Error encountered

Elasticsearch exception is thrown. No search results returned.

Expected Behavior

  • After adding the slash to the escaped characters setting, no Elasticsearch error should be thrown
  • The setting should remove the reserved character before using it as a search string, essentially searching coffee AND tea

Possible Solution

Check for regressions introduced in 2.7... or possibly even 2.6.x?

Context and Notes

No response

Version used

AtoM 2.7.1 - v192

Operating System and version

Ubuntu 20.04

Default installation culture

en

PHP version

PHP 7.4

Contact details

No response

@fiver-watson fiver-watson added the Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result. label Jun 2, 2023
@hggsilva
Copy link

hggsilva commented Jun 7, 2023

I tested it today in a 2.6.2 instance and it still works.
I don’t know whether it also works in 2.6.3 and 2.6.4.

@anvit anvit added this to the 2.8.0 milestone Jul 10, 2023
anvit added a commit that referenced this issue Sep 20, 2023
The search query used in the generateQueryString function does not
escape special characters specified in the escape_queries setting, and
the query provided to it by arElasticSearchPluginQuery has not been
previously escaped either. Updating this to call escapeTerm to escape
the search query so that this setting is respected.
@anvit anvit self-assigned this Sep 20, 2023
@anvit anvit linked a pull request Sep 20, 2023 that will close this issue
anvit added a commit that referenced this issue Oct 3, 2023
The search query used in the generateQueryString function does not
escape special characters specified in the escape_queries setting, and
the query provided to it by arElasticSearchPluginQuery has not been
previously escaped either. Updating this to call escapeTerm to escape
the search query so that this setting is respected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug A flaw in the code that causes the software to produce an incorrect or unexpected result.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants