Fix whitelist/blacklist priority select values#139
Merged
Conversation
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes an off-by-one issue in the whitelist/blacklist priority selector of the ispconfig3_wblist plugin.
Before this change, the priority dropdown displayed values 1–10 in Roundcube, but the submitted values were effectively 0–9. As a result:
selecting priority 1 in Roundcube saved priority 0 in ISPConfig
selecting priority 5 in Roundcube saved priority 4 in ISPConfig
selecting priority 10 in Roundcube saved priority 9 in ISPConfig
ISPConfig itself uses priorities 1–10, so the submitted values should match the displayed values.
Cause:
The priority select only defined display labels:
$input_wblistpriority->add(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']);
This appears to result in submitted option values 0–9.
Fix:
Pass explicit option values matching the labels:
$input_wblistpriority->add(
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
);
Tested with:
Debian 13
ISPConfig 3.3.1p1
Roundcube 1.6.16+dfsg-0+deb13u1
ispconfig3_roundcube current GitHub version
Test result:
selecting priority 5 in Roundcube now saves priority 5 in ISPConfig
selecting priority 10 in Roundcube now saves priority 10 in ISPConfig