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

Fix resources search #1384

Merged
merged 5 commits into from
Mar 6, 2018
Merged

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Mar 5, 2018

Use sanitized search filter params in all resource views.

In Rails 5.1 unpermitted params cause errors while generating urls. Use the sanitized search_filter_params in all our resources views instead of the raw params Fixes this.

Fixes #1337

tvdeyen added 5 commits March 6, 2018 10:29
In all other envs Rails does not raise if unpermitted params are found, it silently drops them. We want the same behavior in test cases. Otherwise we would have to permit or drop every potential parameter.
In Rails 5.1 unpermitted params cause errors while generating urls. Use the sanitized `search_filter_params` in all our resources views instead of the raw `params` fixes this.

Fixes AlchemyCMS#1337
Each call to `search_filter_params` permits the params all over again. This is not necessary.
Since we already have `search_filter_params` we do not need the `current_location_params` (which are exactly the same, but unsafe).
@tvdeyen tvdeyen force-pushed the fix-resources-search branch from 70c28aa to 172f61f Compare March 6, 2018 09:29
@tvdeyen tvdeyen merged commit bb501b5 into AlchemyCMS:master Mar 6, 2018
@tvdeyen tvdeyen deleted the fix-resources-search branch March 6, 2018 09:41
@jkimmeyer
Copy link

Hey @tvdeyen, could you apply this fix also to the 4.0-stable version? Else you can't properly upgrade to Rails 5.1. in combination with alchemy_cms 4.0.5. Thank you!

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.

2 participants