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

Prevent TermsFilter from having to deal with empty strings #8727

Merged
merged 2 commits into from
Jan 15, 2024

Conversation

MatteoPiovanelli-Laser
Copy link
Contributor

We noticed there was a chance for the TermsFilter to throw an exception, locking backoffice users from being able to edit the filter and use it. This happened in some cases when the user would select the taxonomy rather than a term, because the value for the taxonomy is an empty string: that could result in the filter attempting to parse empty strings to integers.
So:

  • filter them out before parsing them to int
  • in the form, convert taxonomies to OptionGroups rather than options with no value, so they should not be selected so easily.

filter them out before parsing them to int
in form, convert taxonomies to OptionGroups rather than options with no value
Copy link
Member

@sebastienros sebastienros left a comment

Choose a reason for hiding this comment

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

Pending recommended changes

@MatteoPiovanelli-Laser MatteoPiovanelli-Laser merged commit e013e00 into OrchardCMS:1.10.x Jan 15, 2024
2 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.

2 participants