-
Notifications
You must be signed in to change notification settings - Fork 116
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 IP exclude rules settings #1036
Conversation
|
||
$( 'tr:not(.hidden) select.select2-select', $excludeList ).each( | ||
function() { | ||
$( this ).select2( 'destroy' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't recreate the select2 fields for rows with them already present.
|
||
// Ugly hack to ensure we always pass an empty value or the order of rows gets messed up. | ||
if ( ! firstSelected.length ) { | ||
$( this ).append( '<option selected="selected"></option>' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the core fix -- we add a dummy option and mark it selected to ensure it gets delivered to the backend.
Fixes #1035.
HTML
select
elements with nothings selected don't get added to the POST request so the exclude conditions with empty IP rules get moved up to previous rules if they don't have an IP address rule.Checklist
contributing.md
).