On Special:Preferences, in the "Watchlist" and "Recent changes" tabs,
there is currently an "Advanced options" section, which contains a
huge list of mostly unrelated checkboxes.
Split off some of them that are actually related to two new sections,
"Watched pages" and "Changes shown", to make it easier to understand
their purpose.
Change-Id: I9bf91b78f6af49214a5d467d0896c63eb376d3d2
Every one of these seemed to previously use the wrong value for
`$interface` -- the interface messages in ProtectionForm and
SpecialVersion were being parsed as content language (which is the
default for `OutputPage::parseInline`), and the one place where we
have actual data in the content language (the user signature, which
gets parsed in the content language with the rest of the (talk) page
content, see Parser.php::pstPass2) was being parsed as an interface
message!
Forcing the caller to be very explicit about AsContent() or AsInterface()
will help mitigate this in the future, one hopes.
Bug: T198214
Change-Id: Ib9d5d8d733a47c967bdf7db3e23fa39f11687063
wgStructuredChangeFiltersShowPreference, wgStructuredChangeFiltersShowWatchlistPreference,
and wgStructuredChangeFiltersOnWatchlist were introduced for progressive rollout
of the RCFilters app on RC and WL.
These variables and their related conditional code is no longer needed.
Bug: T196033
Change-Id: Id3799fefd21cd9bea0e089a5e12576ee9ea1085e
convert() is weird and requires things to be escaped before it
is called.
This fixes a bunch of phan-taint-check warnings.
Change-Id: I422b313ca05ff61ae05e06856347cc0de832cc49
"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
This normalizes handling of transformations on the boundaries between
preferences and generic form controls and removes the special case
where email-blacklist is passed around as an array internally, leaking
into the API.
As a result of this normalization, meta=userinfo no longer returns an
array of users, using the internal representation like action=options.
Bug: T198935
Change-Id: Iff63da0d215585cfcf083e7f7ec8ed45d5b77301
The value of the 'section' parameter is used to generate some ID
attributes on Special:Preferences. Awkwardly, only the second part
(after the slash) is used, so have to ensure these are unique.
It is also used for the default localisation message for the title of
the section. Override this so that we don't have to rename and
duplicate the messages.
Bug: T198875
Change-Id: I0f22aafc8b2ad860dd42c5373eafdf88e848e3ad
When collapsed, make sure we are adjusting the 'min-height' on the
'rcfilters-head' div so that it actually takes the space it should.
Make sure the preference of whether the area is collapsed or not is
preserved for the user, per RC or WL pages, and that it is loaded
properly with the correct minimum height dimensions depending on
which state is in the preferences, so to prevent "jump" of the
result list after load.
Bug: T177206
Change-Id: I82c3042cd1bb85dedcd6b5458b157fed94def808
This change allows only language codes with translations for the user
option 'language'. This restrict the selectable values in the
preferences and also prevents setting the user option via API.
With the URL parameter 'uselang' the user interface language can
still set to a language code without translation.
In the current situation this change will remove the following language
codes from the allowed values:
> print '* ' . implode( "\n* ", array_diff(
array_keys( Language::fetchLanguageNames( null, 'mw' ) ),
array_keys( Language::fetchLanguageNames( null, 'mwfile' ) )
) );
* aa
* als
* bat-smg
* be-x-old
* cho
* fiu-vro
* ho
* hz
* kj
* kr
* mh
* mus
* ng
* no
* rn
* roa-rup
* shi-latn
* shi-tfng
* simple
* tum
* uz-cyrl
* uz-latn
* zh-classical
* zh-min-nan
* zh-yue
The change I1dd6fb1f240ce3319b132d0f29f0622fba33e655 ensures that the
deprecated language codes get replaced by the new language codes. The
other untranslated language codes get replaced by the content language
codes when the user loads the preferences.
Bug: T118199
Change-Id: I1382996b031af3fe9f6e1568beeb6376dcbcd217
This is a follow-up to Idc3dee3a7fb5ebfaef395754d8859b18f1f8769a
containing some less trivial changes.
Change-Id: Ia7af2c1d000307d43278cde4a246df413d4ef263
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '
(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)
Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).
Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
In change 4633f4d46a it was changed
to an interface implemented by both PreferencesFormLegacy and
PreferencesFormOOUI so that existing typehints for some functions
parameter would accept them both. Replace those typehints to use
HTMLForm instead. There was really no guarantee in the past that
they would only be given PreferencesForm or its subclasses, either.
Because the typehint change affects some hooks, note it as a
deprecation in MW 1.31 and a breaking change in MW 1.32.
Also add @since tags and correct some typos in code comments.
Follow-up to 4633f4d46a.
Change-Id: I61749f1d864cf68afe90cd9e15ba2d7a74252501
The old Preference::tryUISubmit() and the new submitForm() would
blissfully return Status::newGood(), even when it isn't good.
Bug: T191933
Change-Id: I4e35c5a71800f88b2063dd0361d83a56f54d58c3
Language::fetchLanguageNames returns already a sorted array. An
additional ksort is only needed when inserting a new value.
Change-Id: If8c7b16fa6e7dfe1545f72ac9c742a2f43eaee57
The siteinfo API response's 'writeapi' value is now hard-set to true,
as are the ResourceLoader variables wgEnableAPI and wgEnableWriteAPI,
to be deprecated later.
Bug: T115414
Change-Id: I54ff9428b247ba203d67aba079149393f323d5a9
This deprecates the Preferences class and replaces it with
a PreferencesFactory service. Basically, all code from Preferences
is moved into DefaultPreferencesFactory. All Prefereces methods
are now either shims calling DefaultPreferencesFactory or just
throw exceptions.
Bug: T178449
Change-Id: Id0b2db0c2de0890f6e1609a9a0dca207c4600f99