aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorhmonroy <hmonroy@wikimedia.org>2025-03-20 13:39:45 -0700
committerhmonroy <hmonroy@wikimedia.org>2025-03-21 12:47:32 -0700
commita666e2e1f86d45f8a00283afbd1495cfbae506fc (patch)
tree2941c68267cc9b3f9a178febf25dfdcd99f1b41b /resources
parente4f5619daee9174ab82b8f42b7f74f4340a34639 (diff)
downloadmediawikicore-a666e2e1f86d45f8a00283afbd1495cfbae506fc.tar.gz
mediawikicore-a666e2e1f86d45f8a00283afbd1495cfbae506fc.zip
Special:Block [Codex]: Set the expiry infinity option in the form
The expiry 'Infinite' option might come from a custom message. Check the options and select the expiry `Infinite` option has been set. Bug: T388653 Change-Id: Ib22ef41deb121dc151a5ea8ca7d4ea5768041c66
Diffstat (limited to 'resources')
-rw-r--r--resources/src/mediawiki.special.block/components/ExpiryField.vue7
1 files changed, 4 insertions, 3 deletions
diff --git a/resources/src/mediawiki.special.block/components/ExpiryField.vue b/resources/src/mediawiki.special.block/components/ExpiryField.vue
index f0d804c88e9e..7ed51c0cfc4a 100644
--- a/resources/src/mediawiki.special.block/components/ExpiryField.vue
+++ b/resources/src/mediawiki.special.block/components/ExpiryField.vue
@@ -156,9 +156,10 @@ module.exports = exports = defineComponent( {
const optionsContainsValue = ( opts, v ) => opts.some( ( option ) => option.value === v );
if ( mw.util.isInfinity( given ) ) {
expiryType.value = 'preset-duration';
- // FIXME: Assumes that the "infinite" option exists.
- // (It has to be for this form as there's no other way to specify infinite)
- presetDuration.value = 'infinite';
+ // Set the "infinite" option that exists.
+ presetDuration.value = presetDurationOptions.find(
+ ( option ) => mw.util.isInfinity( option.value )
+ ).value;
} else if ( optionsContainsValue( presetDurationOptions, given ) ) {
expiryType.value = 'preset-duration';
presetDuration.value = given;