From: Kosta Harlan Date: Thu, 6 Sep 2018 14:50:08 +0000 (-0400) Subject: Watchlist preferences: Disallow zero value for days/limit X-Git-Tag: 1.34.0-rc.0~4173^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/Category:Foo?a=commitdiff_plain;h=89dcdfa826d086439fbec883987f5800695ae39c;p=lhc%2Fweb%2Fwiklou.git Watchlist preferences: Disallow zero value for days/limit "0" used to work as an undocumented shortcut for "maximum allowed" days/edits, but this behavior was removed in If6280ad6fbad65909e1d0b2a48344e24d485aca2 This commit brings the preference options into alignment with how the code functions. Bug: T199049 Bug: T176033 Change-Id: I5ffd87565df6b3c602d1f69d9d63621a817ce8cf --- diff --git a/includes/preferences/DefaultPreferencesFactory.php b/includes/preferences/DefaultPreferencesFactory.php index 07d8b0b840..ec85556b93 100644 --- a/includes/preferences/DefaultPreferencesFactory.php +++ b/includes/preferences/DefaultPreferencesFactory.php @@ -1123,7 +1123,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { $defaultPreferences['watchlistdays'] = [ 'type' => 'float', - 'min' => 0, + 'min' => 1 / 24, 'max' => $watchlistdaysMax, 'section' => 'watchlist/displaywatchlist', 'help' => $context->msg( 'prefs-watchlist-days-max' )->numParams( @@ -1132,7 +1132,7 @@ class DefaultPreferencesFactory implements PreferencesFactory { ]; $defaultPreferences['wllimit'] = [ 'type' => 'int', - 'min' => 0, + 'min' => 1, 'max' => 1000, 'label-message' => 'prefs-watchlist-edits', 'help' => $context->msg( 'prefs-watchlist-edits-max' )->escaped(),