Skip to content

Wrap all string autocomplete values in quotes, not just those containing whitespace#230

Merged
adamruzicka merged 1 commit intowvanbergen:masterfrom
jeremylenz:string-autocomplete
Sep 16, 2025
Merged

Wrap all string autocomplete values in quotes, not just those containing whitespace#230
adamruzicka merged 1 commit intowvanbergen:masterfrom
jeremylenz:string-autocomplete

Conversation

@jeremylenz
Copy link
Contributor

This change modifies AutoCompleteBuilder's complete_value_from_db method.

Previously, DB values that were strings would automatically be wrapped in quotes if the values contained spaces.
Now, DB values that are strings are wrapped in quotes, regardless of contents.

This is so that special operators ('|', '>', etc) don't break queries. For a more detailed explanation of the issue, see theforeman/foreman_rh_cloud#1083.

@adamruzicka
Copy link
Collaborator

adamruzicka commented Sep 3, 2025

Could we get some new tests for this?

Edit: or maybe changing all the currently failing ones would do

@jeremylenz
Copy link
Contributor Author

updated tests

Copy link
Contributor

@ShimShtein ShimShtein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@jeremylenz
Copy link
Contributor Author

Not sure what's going on with the test failures now. can you rerun them @adamruzicka ?

@adamruzicka
Copy link
Collaborator

From what I recall jruby-head tests are always a bit wonky, I wouldn't loose any sleep over them

@jeremylenz
Copy link
Contributor Author

Can we get this in?

@adamruzicka adamruzicka merged commit b9a64fc into wvanbergen:master Sep 16, 2025
24 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants