Similiar to the handling for suppressed edits since b6f148b
Bug: T327538
Follow-Up: I08f14f712479e1b170c606e2b64857f8386acd76
Change-Id: Icfb46d9ef02984510ef1c2c5e4785345cbe6ad2f
Code that needs to store an actor ID in the database to
represent a UserIdentity, or needs to construct a UserIdentity based on
an actor ID loaded from the database, should use the ActorNormalization
service.
Note: The getActorId() method is removed from the UserIdentity interface,
but all concrete classes continue to support it for now.
UsererIdentityValue::getActorId() is hard deprecated and should
be removed in 1.37. It always returns 0.
User::getActorId() is not deprecated at this point.
Bug: T274179
Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237
Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
Most of these are found by the not yet released I10559d8.
I remove the type MockObject in some cases when the calling
code really does not need to know if he get's a mock or the
real thing. However, I do this only in places that are very
closely related to the fixes.
Change-Id: I26a4c3c5a8ae141bf56161b52b54bce7e68f2e30
This was done automatically by replacing every assertContains with
string *needle*. Then verifying the results.
Bug: T192167
Change-Id: Id8cbbf3b01e948f80046714183cc299f86be21fd
This commit splits changes from Ic14f5debc53e55d6714 to reduce it to
only strictly needed things. It can be merged immediately.
Bug: T192167
Change-Id: I8c541a66ea13421dbe7fa51d197d5455cc4786eb
Languages with variants no longer can override the parent's constructor
(which is now used for injecting services). Instead, they need to
override Language::newConverter().
Bug: T201405
Change-Id: I923400d61763cf1db88cb0c3f684c9c10e58032d
This removes Language::$dataCache without deprecation, because 1) I
don't know of a way to properly simulate it in the new paradigm, and 2)
I found no direct access to the member outside of the Language and
LanguageTest classes.
An earlier version of this patch (e4468a1d6b) had to be reverted
because of a massive slowdown on test runs. Based on some local testing,
this should fix the problem. Running all tests in languages is slowed
down by only around 20% instead of a factor of five, and memory usage is
actually reduced greatly (~350 MB -> ~200 MB). The slowdown is still not
great, but I assume it's par for the course for converting things to
services and is acceptable. If not, I can try to optimize further.
Bug: T231220
Bug: T231198
Bug: T231200
Bug: T201405
Change-Id: Ieadbd820379a006d8ad2d2e4a1e96241e172ec5a
This removes Language::$dataCache without deprecation, because 1) I
don't know of a way to properly simulate it in the new paradigm, and 2)
I found no direct access to the member outside of the Language and
LanguageTest classes.
Change-Id: Iaa86c48e7434f081a53f5bae8723c37c5a34f503
This makes LogFormatter more robust against bad user names coming from
broken log records.
Bug: T224368
Change-Id: Ifce9e86bddba274182253cd25338766e8093d6ad
This function had been changed to unconditionally disable parentheses,
but none of its callers load the CSS needed to make that work.
Bug: T220767
Change-Id: I566d65e155258d3bd1a1a06bca9aa2b3a2d417ee
Follows-Up: I6eeeaa3b58d37adb7fefb4cc6915022229b3b324
If the title for a 'title' or 'title-link' type is invalid, the code
still must not return a non-array from the method.
I'm not sure this is what was behind T176938, but it's the only thing I
can find that might cause the errors I saw logged at about the same
time.
Change-Id: Iae77eb6ad9a64d8b67074164ff0c0fea36826f3c
Right now it's quite slow because it reloads LocalisationCache
for every test case.
Change the reload to only happen once for the entire class.
Also use RequestContext instead of wgLang to match logic in
the parent class (MediaWikiLangTestCase).
$ phpunit includes/logging/LogFormatterTest.php
Before
- run 1) Time: 23.56 seconds, Memory: 48.00MB
- run 2) Time: 22.41 seconds, Memory: 48.75MB
After
- run 1) Time: 14.27 seconds, Memory: 47.50MB
- run 2) Time: 13.45 seconds, Memory: 47.25MB
Change-Id: Ia791563ca9094c36782acfe9826def45f2a1d621
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
Change-Id: I46261416f7603558dceb76ebe695a5cac274e417
This localize the protect type, level and expiry on Special:Log/protect.
To allow i18n there are some details stored in the log params of new log
items, these details also shown on API output.
The details cannot get from the old existing data, because there are
containing L10n strings therefore i18n works only for new items.
In the api and for IRC the old description text is still stored in the
log params for backward compatibility.
This allows use of gender on Special:Log. Old messages are kept for use
in IRC. Tests already exists to ensure an unchanged IRC message.
Bug: T47988
Change-Id: I3bb85c61b857972e66c99c499d7d785c88cafb25
This moves out a bunch of stuff that doesnt
seem to test anything in RecentChange....
This also shows us how few tests RecentChange
actually has!
Change-Id: Ia5016c82c00dd7c35a6f1253d6e385b587ec485e
This allows for extensions to format their log entry parameters, and
keeps the code for formatting API log entry parameters in the same place
as for other formatting.
This also takes the opportunity to rearrange the output format slightly
to avoid conflicts like what's happening in T73020.
Bug: T35235
Bug: T73020
Bug: T91466
Change-Id: I6846ce09322eb404c506b5a51780a44ce9279fe2
LogFormatterTest replaces all extension localization files in
$wgExtensionMessagesFiles with its own, and correctly restores this
variable. But it neglects to refresh the localization cache after
restoring the variable, so subsequent extension tests are missing their
localization.
Change-Id: I74809af47830a5e09c36f8fec20c9c65b1e3aa17
This change adds types to LogFormatter like "msg" so log values
(parameters for the log message) can be formated as e.g. a message in
user or content language.
This change adds tests for LogFormatter, too. Tested are the normal log
params, the log params with type and the output of the comment.
This change repairs the changes I6a56c204 and I7218a173
Change-Id: Ief3665056b3bb613ff709821306017ee7967c444
As I6a56c204 breaks extensions because of changing protected methods to public, this has to be reverted. We need a solid solution and the next 1.21-wmf is being branched tomorrow. Revert is the sanest solution at the moment.
This reverts commit 888fe0ffb3
This change adds tests for LogFormatter. Tested are the normal log
params, the log params with type and the output of the comment.
Change-Id: I7218a1738c97db1d888605cecdfbffe21ca00fbf