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

file search for a number terminating with underscore results in an exception #1434

Closed
MontrealSergiy opened this issue Sep 27, 2024 · 3 comments
Labels

Comments

@MontrealSergiy
Copy link
Contributor

MontrealSergiy commented Sep 27, 2024

To reproduce in file search field enter 24_ or enter url
https://portal.cbrain.mcgill.ca/userfiles?name_like=24_&_=1727287061912

One would expect CBRAIN quietly return list of files starting with 24_ , and yet an exception is generated during yaml serialization of the string.

Perhaps, as a workaround one may add quotations over the string.
In a rails 5.0.7 console/ ruby 2.7 '2_'.to_yaml generates an exception, but rails works fine with for '"2_"'.to_yaml

The issue is corrected in more recent psych releases, see PR https://github.com/ruby/psych/issues/442
Updating to recent psych would be more clean bug fix but will require all developers to update their setup

@MontrealSergiy
Copy link
Contributor Author

I tried to update to the latest psych (5.1.2) but got Tried to load unspecified class: Time error at during CBRAIN 'initial check'

@prioux
Copy link
Member

prioux commented Sep 30, 2024

I already fixed this. See 435a133

@prioux prioux closed this as completed Sep 30, 2024
@MontrealSergiy
Copy link
Contributor Author

MontrealSergiy commented Sep 30, 2024

That's a great and elegant workaround, but upgrading would save us from the same issue around the whole application. While the latest releases of psych 4 and 5 are too advanced, 3rd version seems to do the trick gem "psych", '~> 3.3'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants