Commit graph

14753 commits

Author SHA1 Message Date
Petr Pchelko
92a88e4e07 Special:Contributions - verify early year and month are ints
Bug: T293293
Change-Id: I96cf8a24a329dad26e2bf76bf4495c192e296577
2021-11-01 19:16:12 -07:00
Umherirrender
7e24705bcd Exclude null values for flag UserOptionsManager::EXCLUDE_DEFAULTS
isset returns false for null and the null values are not compared,
that treats them as non-default, even the default is also null.

Bug: T291748
Follow-Up: I6e61c11d8aed27b4b559e74849e0056e5eef3638
Change-Id: I0a0932b403098967c261eee3dc0e7d5da3c4fffb
2021-11-01 20:44:13 +01:00
jenkins-bot
bba758a65c Merge "Remove unused class fields in LinkRenderer" 2021-11-01 16:22:24 +00:00
jenkins-bot
bde944737d Merge "Use PageUpdater in API test to add revision" 2021-11-01 15:34:31 +00:00
Michael Große
045f1ffb4c Remove unused class fields in LinkRenderer
NamespaceInfo was added in
I4af843238ffd58925f57c0f7b98253a90cb285ec
and removed in:
I5c9ea04a9deca136bb7210f07200d18f97fd6686

Change-Id: I64612b57b0e5e5c7c126d7434e5b108fc735ac57
2021-11-01 15:59:42 +01:00
jenkins-bot
35d9c32cc4 Merge "Hard-deprecate Content::getParserOutput and AbstractContent::fillParserOutput." 2021-11-01 13:57:42 +00:00
WMDE-Fisch
e686e06c38 Use PageUpdater in API test to add revision
Change-Id: I9ba1357c0556d572594f4750403b24b5b8cdbdc0
2021-11-01 10:49:52 +01:00
jenkins-bot
5de5c90ac4 Merge "tests: Merge test cases into data provider & remove helper method" 2021-11-01 09:44:30 +00:00
James D. Forrester
20fd877da4 Drop experimental FileJournal system without deprecation
The feature was introduced in 2012 with d19f54602f (just before
the gerrit migration).

Change-Id: Ia3f59ad0ddeb1f610947b14e22b0694ff4c6ed84
2021-11-01 14:08:09 +11:00
Derick Alangi
29ddb9b716 tests: Merge test cases into data provider & remove helper method
NOTE: Deprecated `Http::isValidURI()` was updated to the recommended
method code.

Change-Id: I419f18a43278ca5926047037cecb4fa9bcb2017a
2021-10-31 19:58:49 +01:00
jenkins-bot
1d5332977b Merge "resourceloader: Remove use of Timing class" 2021-10-30 06:52:33 +00:00
jenkins-bot
5b27523cee Merge "actions: Update deprecated code in Actions::checkCanExecute()" 2021-10-29 11:15:41 +00:00
Roman Stolar
957697e1e0 Hard-deprecate Content::getParserOutput and AbstractContent::fillParserOutput.
Use ContentRenderer::getParserOutput instead.
Extensions defining a content model should override ContentHandler::fillParserOutput.
Update tests.

Bug: T287158
Change-Id: I1c71a8429806f1813a39f5807256b2eb9fb9901f
2021-10-29 14:04:22 +03:00
daniel
c1fce9dfd6 wfParseUrl: add regression test for T294559
As of PHP 7.2, parse_url does not correctly handle ports on protocol
relative URLs. Ensure that we properly compensate for this.

Bug: T294559
Change-Id: I52c661cbff5e6f28120b50111659255d712d6887
2021-10-29 10:57:14 +02:00
jenkins-bot
95af3986a1 Merge "Metrics: Add test coverage for getRenderedSamples() and send()" 2021-10-28 20:32:53 +00:00
jenkins-bot
6080c9df86 Merge "Revert "wfParseUrl: rely on parse_url for proto-relative urls"" 2021-10-28 19:26:21 +00:00
Urbanecm
a568fdedc3 Revert "wfParseUrl: rely on parse_url for proto-relative urls"
This reverts commit 66e58d1ea7.

Reason for revert: let's revert and hope this will fix T294559

Bug: T294559
Change-Id: I2e4ae268e288f87b6c80fac08d275118f5b5cbd7
2021-10-28 19:04:46 +00:00
Derick Alangi
2c10f768f0 actions: Update deprecated code in Actions::checkCanExecute()
Inspired by T290004, attempting to solve that ticket will be done
in the next patch on this one.

Bug: T290004
Change-Id: I431e3eba1bcfb446a4ab60aa3d2189762ea9f65f
2021-10-28 11:23:32 +01:00
jenkins-bot
8274d7dbd6 Merge "Use expectException() in ActionTest" 2021-10-28 02:05:51 +00:00
Daimona Eaytoy
55b1c430ed Use expectException() in ActionTest
This way the intent is clearer, and it also properly covers the case
where the exception isn't thrown.

Change-Id: I7831382956d5bc204b695fecc47f7111519d53af
2021-10-28 03:05:43 +02:00
jenkins-bot
7766b0206e Merge "Give skins more flexibility over table of contents render" 2021-10-27 23:02:57 +00:00
Umherirrender
b9269eda80 resourceloader: Remove use of Timing class
Do it self to avoid the global state of the Timing class within the
resourceloader.
Replaced the deferred update with a scoped callback to send stats on all
possible return path for the called function, but directly when needed
and not deferred, which can make wrong times.
The old code was using a fix mark set be
MediaWiki::doPostOutputShutdown, where a defered send does not has
impact of the send stats

Change-Id: I5fec6a73db3e7c3ac6a6ac33bb293727ae3a38ca
2021-10-26 22:58:07 +02:00
jenkins-bot
fdaf95c524 Merge "ApiQueryImageInfo: don't show empty comments as deleted" 2021-10-26 19:59:25 +00:00
Petr Pchelko
392d2af20c ApiQueryImageInfo: don't show empty comments as deleted
Bug: T293783
Change-Id: Icddd06c7171bc1d1dba14ec7d6703e082b87836a
2021-10-26 11:36:09 -07:00
jenkins-bot
e0f7759256 Merge "Hard deprecate LinkCache::addGoodLinkObj" 2021-10-26 15:51:05 +00:00
vladshapik
1ae8e89eb5 Hard deprecate LinkCache::addGoodLinkObj
LinkCache::addGoodLinkObj was hard deprecated.
Use addGoodLinkObjFromRow() instead. PHPUnit tests
must use LinkCacheTestTrait::addGoodLinkObject().

Bug: T284955
Change-Id: I0c22be2f00e6d6d4ba6dd1511c5385cad55e8ff7
2021-10-26 18:21:32 +03:00
jenkins-bot
3327b4a1a1 Merge "Cleanup hard-deprecated code in blocks." 2021-10-26 14:41:09 +00:00
jenkins-bot
b98d8b6060 Merge "Make SlotRecordTest a unit test" 2021-10-26 14:17:50 +00:00
Petr Pchelko
25bb5b296a Cleanup hard-deprecated code in blocks.
Change-Id: I1b3f4a0f072197c6b3dc6c9a80fcb2946aeb6360
2021-10-26 06:44:05 -07:00
Petr Pchelko
164ec5cb29 UserOptions: remove deprecated hooks.
After the hooks were removed we are finally ready to stop
reading user options from primary before writing them on save.
The new save hooks only work on modified options, so options
saving code can be significantly simplified.

Change-Id: I48df616c9f35d9a0b2801ada1b7dbef0bd4ad058
2021-10-26 12:55:01 +00:00
Winston Sung
6eda8891a0 Update 台灣 to 臺灣 according to Wikipedia-zh village pump discussions
https://zh.wikipedia.org/wiki/Wikipedia:互助客栈/其他/存档/2019年2月?oldid=61018059#「台灣」「正體」?

Follow-up of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/700626

Change-Id: I6d2a128f682e71312400b97333ffbfffe9968ee7
2021-10-26 11:02:07 +00:00
jenkins-bot
9b05a56a5d Merge "resourceloader: Change User::isAnon to !User::isRegistered" 2021-10-26 09:45:37 +00:00
jdlrobson
24949480eb Give skins more flexibility over table of contents render
* Do not store table of contents in parser output
* Instead inject table of contents via strpos where needed
  inside Article based on Skin "toc" option
* Use <mw:tocplace> as a TOC placeholder; for Parsoid compatibility
  this will be replaced with a <meta> tag in a followup patch.

Bug: T287767
Change-Id: I44045b3b9e78e7ab793da3f37e3c0dbc91cd7d39
2021-10-25 22:26:41 +00:00
jenkins-bot
4cd4eec36f Merge "Reapply "Update user_touched after saving user options."" 2021-10-25 21:10:43 +00:00
Ppchelko
8ff180948c Reapply "Update user_touched after saving user options."
This reverts commit 4d19d06455.

Reason for revert: CenralAuth tests fixed

Bug: T284354
Depends-On: I9d681baeca0df4808335e7bececfd114cdad2f0e
Change-Id: I483b8f61dcfae70c5a50399391b361cf5310ae24
2021-10-25 20:28:07 +00:00
jenkins-bot
226dbef3f6 Merge "user: Add default value for all "variant" user option keys" 2021-10-25 20:07:36 +00:00
Umherirrender
1b334a48e9 user: Add default value for all "variant" user option keys
Without a default the preference is treat as unknown and possible values
identical to the default are not excluded from javascript code or
database.

Bug: T291748
Change-Id: I37cf1cd87a5ef1fd91aba0c3cc4b0e3f9c9c08b4
2021-10-25 19:45:59 +00:00
Tks4Fish
76e3701d6a OutputPage: Remove $wgLoggedOutMaxAge experiment and related tests
Bug: T293848
Change-Id: I5e5e52fac7fe389b36715dae11cc30cdb2b9136a
2021-10-25 19:33:32 +00:00
jenkins-bot
98fbea6293 Merge "Fix PHP warning with some inputs to wfCgiToArray()" 2021-10-25 18:58:01 +00:00
Alexander Vorwerk
4d19d06455 Revert: "Update user_touched after saving user options."
This reverts commit 98878c08ba.

reason for revert: had some weird and unwanted side effects

Bug: T294265
Change-Id: I53c2175498af5b37096505dae011e65cebf029aa
2021-10-25 16:33:10 +00:00
jenkins-bot
a4b5426e4c Merge "Type-hint LinkTarget" 2021-10-25 14:53:17 +00:00
jenkins-bot
2bd3e49169 Merge "Update user_touched after saving user options." 2021-10-25 14:48:26 +00:00
Matěj Suchánek
b411cbfdaa Split PageArchiveTest
Create ArchivedRevisionLookupTest to test ArchivedRevisionLookup.
Expand tests a bit and add two more for ::getPreviousRevisionRecord.

Change-Id: I3e176b24a13479464b7e73d062639ecb4db86f8f
2021-10-25 10:41:33 +02:00
Umherirrender
7ce7e0d4aa resourceloader: Change User::isAnon to !User::isRegistered
User::isRegistered is part of the UserIdentity interface,
which makes moving from heavy User class to UserIdentity easier.

Change-Id: If44bfd398694c509272b3f89c93473b2e3c05759
2021-10-24 10:00:51 +00:00
Timo Tijhof
f603b00abf Metrics: Add test coverage for getRenderedSamples() and send()
Also various other code clean ups:

* Fix warning during PHPUnit coverage run for invalid @coverage target:

> 1) Wikimedia\Tests\Metrics\MetricTest::testValidateLabels
> Trying to @cover not existing class "\Wikimedia\Metrics\Metric".

* Move "expectException" lines to right above the expected failure
  instead of at the start of the method, which aligns with how this
  is typically done in PHPUnit tests.

* Remove TestCase constructor overrides. This is not supported by
  upstream. We generally use setUp() or setUpBeforeClass() for this.

  In this case, remove it entirely in favour of NullLogger without
  any re-use between test methods.

* Change github.com URL to permalink.

* Favour early returns for error handling to separate input validation
  from storing in-object which makes it harder to separate what is and
  isn't valid at any particular point. This is mostly for consistency
  with other MW code, but also happens to make the code simpler in
  this case.

Bug: T240685
Change-Id: I36368cc0aadff7e24fe55dec2eda1365efd779af
2021-10-23 03:13:40 +00:00
jenkins-bot
743dc72f25 Merge "Hide deprecation on tests for ParserOutput::addWarning" 2021-10-22 21:53:17 +00:00
Alexander Vorwerk
bd13a42535 build: Update mediawiki-codesniffer from v37.0.0 to v38.0.0
Change-Id: Iff096d3789b8c261aa47fb41d6f450a3bda7ce6a
2021-10-22 22:43:16 +02:00
Bartosz Dziewoński
2254eba8aa Fix PHP warning with some inputs to wfCgiToArray()
Also add some more tests for it.

Bug: T294017
Change-Id: I8a4faa42c2219ce415fbb82a248b07a28b59157d
2021-10-21 20:49:34 +02:00
Matěj Suchánek
61289e0290 Deprecate replaced PageArchive methods
Change-Id: I07fe12e6e96c6a27b66655f179c09f624180daa3
2021-10-21 18:28:03 +02:00
jenkins-bot
0ce8ac7f7e Merge "tests: Call parent tearDown at end of teardown in BackupDumperPageTest" 2021-10-21 00:28:48 +00:00