Instead of depending on full User objects, accept
UserIdentity(Value), we only needed User::getTalkPage
but that is trivial to recreate with UserIdentity.
By switching to UserIdentityValue objects, we can specify
the user id easily and not need to load from the database.
Also, give the anonymous user an ip address for the name.
Use a data provider for doTestUserHasNewMessages
Change-Id: I4d1d0226aeee154db42a31b56873e428cd46b64f
This was soft-deprecated in 0171846c, since when all uses in Wikimedia
production code have been removed. As this is such a vital and widely-
used method, we'll want to deprecate it for at least two releases. and
so we should get this in at a time when we're willing to fix many such
uses. Why not now?
Bug: T270450
Change-Id: I8ac4a91d77c2bb748183b69b3e901cce93cbc940
Given that User::getID is a very common method, used very early
during setup (e.g. during session initialization), only load
its dependency when it's really needed.
Bug: T282320
Change-Id: I6565426e9bf7084b1a33d39b2882639a03210460
This is no longer needed in Wikimedia production. Third
party users will have had a release to adjust to one of
the three called-out migration issues. It's time.
Bug: T277987
Change-Id: Ia4a797afc71441ed9a7a90ff4f1e72cc4495cf63
When a wiki is installed with its script path as the document root,
then WikiModule would pass MediaWiki's wgScriptPath value (empty string)
to CSSMin as base url, which is invalid.
A similar bug was recently fixed in FileModule with I16abf482e3a1a.
Bug: T282280
Change-Id: I0b9a67aa912eb3a0320631027303cedf3f348bb8
Note that this changes the effective type of the protected mCancelTarget
field. This fields has no declared type, and does not seem to be used in
any subclass. The type of mTitle is not changed at this time, but
nothing seems to rely on that either.
Bug: T278459
Change-Id: I4bf0d46c74b53ffc9cb3e6e497c789ef6b3bab6a
The parsing of the timecorrection useroption was split over multiple
classes. Combine into a single class and add some testcases.
Change-Id: I2cadac00e46dff2bc7d81ac2f294ea2ae4e72f47
In order to prevent bad titles from entering the database,
PageIdentityValue should not allow instances that have obviously broken
dbeys, just like it does not allow construction for a special page.
Note however that for now, we allow PageReferenceValue to represent
thigns that are not actual pages, such as titles like "User:#1234" which
are used in the block log to represent autoblock targets. Similarly,
a PageReferenceValue can represent a special page.
This patch introduces a convenience method for constructing
PageIdentityValues in a context where it is uncertain whetehr the title
is valid, providing an opportunity to the caller to report in which
context the bad values were found.
In addition, this patch adds some documentation and testing, to clarify
the semantics of methods in PageStore with respect to invalid and non-
proper titles.
Bug: T282070
Change-Id: I8a44d9e73dda8fe38d009847332946809767d0fa
LinkBatch used to be lenient about receiving null or invalid titles.
This patch restores this lenient behavior.
Bug: T282180
Bug: T282070
Change-Id: I2c6378a3a0d508c77bcb290a6ed07f4d5f96d62c
This ensures tests can run from phpstorm directly, without MediaWiki's
custom phpunit wrapper.
Background:
$wgCanonicalNamespaceNames needs to be declared in DefaultSettings so
it works properly when Setup.php is included via
wfRequireOnceInGlobalScope, as is the case in
MediaWikiIntegrationTestCase::initializeForStandardPhpunitEntrypointIfNeeded.
wfRequireOnceInGlobalScope will import any variables in the global scope
into the local scope to make them available in the included file. It
also exports all variables declared in the scope of the included file to
the global scope, but only after the file includsion returns.
If $wgCanonicalNamespaceNames is not defined in global scope before
Setup.php runs, then the $wgCanonicalNamespaceNames variable defined in
Setup.php will not become global until after Setup.php finishes.
However, Setup.php instantiates services that need
$wgCanonicalNamespaceNames to be present. This causes the test framework
to fail.
Change-Id: I8c5179433737170303f37cb072cb0352006ca173
Don't show namespaces or actions that are not active (eg. uninstalled
extension) in block information
Bug: T280798
Change-Id: I14fa7006b3d46eeb41d53216c5203d294fff6338