Commit graph

108479 commits

Author SHA1 Message Date
Umherirrender
b126dbe3f2 Fix various documentation related to null types
The functions returning null or the class property is set explict null

Found by phan strict checks

Change-Id: I4a271093fb6526564d8083a08249c64cb21f2453
2022-02-26 10:31:24 +01:00
Amir Sarabadani
89ef0a943d ContentHandler: Use ParserOutputAccess for accessing ParserOutput
This utilizes class cache to avoid duplicate parses

Bug: T302620
Change-Id: I23c053df4cca5b701d2edafc07c484702f2cc85e
2022-02-25 20:08:55 +01:00
jenkins-bot
ce689a0059 Merge "composer.json: Add ext-simplexml to require-dev" 2022-02-25 18:08:54 +00:00
jenkins-bot
b9b4bee0bf Merge "composer.json: Add ext-calendar to require" 2022-02-25 18:06:18 +00:00
jenkins-bot
ae1c5d0cbc Merge "Convert SearchFormWidget namespace checkboxes to OOUI" 2022-02-25 17:28:27 +00:00
jenkins-bot
e4a3b0d65a Merge "tests: Change use of AtEase to at operator" 2022-02-25 16:40:25 +00:00
Ammarpad
8c559f717e Language: Document StubUserlang in methods that accept it
Many Language methods can't be typehinted with Language as long as
$wgLang/StubUserLang are not completely removed (T160814)

Lack of explicit StubUserlang in the param type often make it
possible for the typehint to be reintroduced after it was removed,
as it happened in Iec1b562 and If72d054

Change-Id: I9b3e87baf38091e2de428de0c92c5a8a6fea32ea
2022-02-25 16:55:50 +01:00
jenkins-bot
71981c21ac Merge "Hard-deprecate Article::doDelete" 2022-02-25 15:29:40 +00:00
jenkins-bot
93e3053fcc Merge "mediawiki.special.search.styles: Don't break columns inside checkboxes" 2022-02-25 14:52:32 +00:00
Daimona Eaytoy
662e644a0c Hard-deprecate Article::doDelete
Unused in WMF-deployed code.

Change-Id: If8430aba5d2bebcb8e11e2fc6617187c1fd0302d
2022-02-25 14:29:50 +00:00
Reedy
951063a72b composer.json: Add ext-simplexml to require-dev
Used by ExportTest and RandomImageGenerator

Bug: T302540
Change-Id: I1ebb975905687174bae753b7165c58653c715833
2022-02-25 12:45:04 +00:00
Reedy
1d21dbb138 composer.json: Add ext-calendar to require
Used by HistoryAction

Bug: T302540
Change-Id: I8e77efa1192a3c5b61c36a674d991389e6aba8cb
2022-02-25 12:41:42 +00:00
jenkins-bot
5bfe1cfaab Merge "rdbms: Move another batch of transaction management code" 2022-02-25 11:51:53 +00:00
Translation updater bot
392781c2ac Localisation updates from https://translatewiki.net.
Change-Id: I2f13b31c2d1654c7d582ec8188b9d04ff623feee
2022-02-25 09:21:55 +01:00
jenkins-bot
52c19e6662 Merge "In parserTests.php, load test extension classes" 2022-02-25 08:03:27 +00:00
Gergő Tisza
69906cb6fd
Remove TrivialLanguageConverter::__construct() type hint
Follows up I29574c20d2963de826108e5ad9e7e22ec6571ebe.

Bug: T302554
Change-Id: I092a71eb7de56f5e9e8879738ee59a477cf851f7
2022-02-24 22:49:00 -08:00
Gergő Tisza
c1d7cbb996
Remove LanguageConverterFactory::instantiateConverter() type hint
Sometimes the method is called with a stub language object.
There are probably better ways to avoid that in the long-term
but for now this is a risk-free fix.

Change-Id: I29574c20d2963de826108e5ad9e7e22ec6571ebe
2022-02-24 21:53:44 -08:00
Tim Starling
b5b3dcfe01 In parserTests.php, load test extension classes
In parserTests.php, instruct ExtensionRegistry to load test classes,
since I recently moved some TimedMediaHandler test classes from
AutoloadClasses to TestAutoloadClasses for preload support, which
broke parserTests.php.

Change-Id: Ibc620865b1ce0f3ae95340477005b977f0509a2b
2022-02-25 12:21:45 +11:00
Timo Tijhof
c2cd7147de mediawiki.base: Remove deprecated stateful Message#toString
Based on mw-js-deprecate reports, there has been not a single trigger
of this in the past three months, apart from me and others testing it
a few times in early December 2021.

https://grafana.wikimedia.org/d/000000037/mw-js-deprecate?viewPanel=38&orgId=1&from=1638316800000&to=1645653600000

Bug: T292489
Change-Id: I0b120ac77040bd0c9bb05d9000169d23c9aa235a
2022-02-25 00:34:11 +00:00
jenkins-bot
76e581d081 Merge "mediawiki.base: Rewrite old mw.Message documentation" 2022-02-25 00:31:31 +00:00
jenkins-bot
e4d1ec4481 Merge "i18n: Adjust Special:UserRights messages to refer to user groups not rights" 2022-02-24 23:28:22 +00:00
Timo Tijhof
128debb64b tests: Change use of AtEase to at operator
Follows-up I361fde0de7f4406bce6ed075ed397effa5be3359.

Per T253461, not mass-changing source code, but the use of the native
error silencing operator (@) is especially useful in tests because:

1. It requires any/all statements to be explicitly marked. The
   suppressWarnings/restoreWarnings sections encourage developers to
   be "lazy" and thus encapsulate more than needed if there are multiple
   ones near each other, which would ignore potentially important
   warnings in a test case, which is generally exactly the time when
   it is really useful to get warnings etc.

2. It avoids leaking state, for example in LBFactoryTest the
   assertFalse call would throw a PHPUnit assertion error (not meant
   to be caught by the local catch), and thus won't reach
   AtEase::restoreWarnings. This then causes later code to end up
   in a mismatching state and creates a confusing error_reporting
   state.

See .phpcs.xml, where the at operator is allowed for all test code.

Change-Id: I68d1725d685e0a7586468bc9de6dc29ceea31b8a
2022-02-24 21:29:51 +00:00
jenkins-bot
1fdb831285 Merge "Replace some more usages of Wikimedia\(suppress|restore)Warnings()" 2022-02-24 21:02:14 +00:00
jenkins-bot
b8d023d09c Merge "block: Replace DateTime::createFromFormat by wfTimestamp" 2022-02-24 21:01:12 +00:00
Timo Tijhof
5bc9bedf4e mediawiki.base: Rewrite old mw.Message documentation
* Don't promote use of `new mw.Message(mw.messages)` which we never
  do in practice.

* Remove mention of deprecated and internal `.format` state.

* Rephrase plain(), text() etc based on what they do for the caller,
  not how they work internally.

* Fix mistake in parse() which claimed to be like plain() whereas
  it is actually like escaped() - when jqueryMsg is absent.

Bug: T292489
Change-Id: I91f6b5362b66eed17660b660615837a540af94cb
2022-02-24 20:56:28 +00:00
Taavi Väänänen
5fcbadb684 i18n: Adjust Special:UserRights messages to refer to user groups not rights
Bug: T296056
Change-Id: Ic68ed5d9f7a219cb2fbcc9e32bcdd70182aa9120
2022-02-24 15:51:19 -05:00
Reedy
86934b2fa8 Replace some more usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: I2eb133a9e32116cd155f59086245bc4d15ecbfcc
2022-02-24 20:27:46 +00:00
jenkins-bot
99e1b7312e Merge "preferences: Use a faster and simpler form descriptor when validating" 2022-02-24 19:16:34 +00:00
jenkins-bot
83db156ccb Merge "tests: Replace some usages of Wikimedia\(suppress|restore)Warnings()" 2022-02-24 18:19:38 +00:00
Func
07b4daf85d preferences: Use a faster and simpler form descriptor when validating
Message parsing used to be the biggest part of loads during
DefaultPreferencesFactory::loadPreferenceValues(), since it need to
load form fields to validate existing user preferences.

Message names in form descriptor can be unset as much as possible,
but special cases should be carefully handled.

Bug: T58633
Change-Id: I1b5c2331e6d5a63f296b4147a91aecb39abf3530
2022-02-24 18:16:43 +00:00
jenkins-bot
dcf44db379 Merge "Use ObjectFactory in LanguageConverterFactory" 2022-02-24 18:11:54 +00:00
jenkins-bot
dc9d030453 Merge "api: Fix documenation/types related to null and int types" 2022-02-24 18:09:06 +00:00
jenkins-bot
3e28671b48 Merge "reassignEdits: Only UPDATE tables if there's rows to update" 2022-02-24 17:43:50 +00:00
jenkins-bot
a701d2d635 Merge "maintenance: Replace some usages of Wikimedia\(suppress|restore)Warnings()" 2022-02-24 17:39:29 +00:00
Umherirrender
6a3cdd15e1 api: Fix documenation/types related to null and int types
Found by phan strict checks

Change-Id: I2b2ae12ca39d67140f0f3c1cc5066c8ef72716de
2022-02-24 17:16:36 +00:00
Umherirrender
a9bc9f8a04 Use ObjectFactory in LanguageConverterFactory
Use the object factory to inject service into TrivialLanguageConverter
class.
The other language converter classes does not use service directly.
The classes are using indirectly services in some function of
the parent class, which needs injection as well (tracked with T294185).

Needs fallback to global state in TrivialLanguageConverter, because the
class is used in extensions integration tests

Change-Id: If72d054d062a4f357e12c5b168e118bfafffd626
2022-02-24 17:47:09 +01:00
jenkins-bot
df0801833a Merge "ParserOutput: Use page language instead of site content language for conversion" 2022-02-24 16:08:07 +00:00
Taavi Väänänen
074bdbec2c
Fix UserGroupManager::listAllGroups() returning duplicates
Fixes a bug where if a group both inherited its rights from some other
group and had rights of its own (which seems like something we should
support), that group would be listed twice on Special:ListGroupRights.

Change-Id: Ie3d93287aa256a7ed50e48a78b5996a193e9b60f
2022-02-24 16:35:49 +02:00
dylsss
f36877764d Convert SearchFormWidget namespace checkboxes to OOUI
Bug: T301500
Change-Id: Ia2b994bb8f59fc3826721701e430e0c3b11fd952
2022-02-24 13:53:33 +00:00
Bartosz Dziewoński
e35f82209e mediawiki.special.search.styles: Don't break columns inside checkboxes
Bug: T300574
Change-Id: Ida97235b94f84efab1f6859f96539bb0f40f9488
2022-02-24 14:51:49 +01:00
Reedy
12aae45101 tests: Replace some usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: I361fde0de7f4406bce6ed075ed397effa5be3359
2022-02-24 12:55:25 +00:00
Reedy
8016d7262f maintenance: Replace some usages of Wikimedia\(suppress|restore)Warnings()
Change-Id: Id1a2d0dedd3326083b6a9727f1ab68ddd8f65df8
2022-02-24 12:52:05 +00:00
Reedy
d8d2bbb1a8 reassignEdits: Only UPDATE tables if there's rows to update
* Removes no-op UPDATE on archive table
* Only does UPDATE on revision/revision_actor_temp if there are rows to update
* Better variable names
* Make use of selectRowCount() wrapper

Change-Id: I971e0808ec27d3da432241d668f2a8313238e820
2022-02-24 12:48:28 +00:00
jenkins-bot
0c2961a237 Merge "Should be possible to use Linker static functions without global context" 2022-02-24 11:39:58 +00:00
Translation updater bot
4a373f6986 Localisation updates from https://translatewiki.net.
Change-Id: Idf4287d9d50e1eea7fe59601f13bb95c82ad2450
2022-02-24 08:23:08 +01:00
jenkins-bot
043ef20cd0 Merge "Fix documentation about mode for ContentSecurityPolicy Hooks" 2022-02-24 06:48:37 +00:00
jenkins-bot
4dfcb287c3 Merge "Revert "Show message fallback keys when using &uselang=qqx"" 2022-02-24 06:38:31 +00:00
jenkins-bot
2e70057dc8 Merge "api: Remove ApiQueryBlocks::prepareUsername" 2022-02-24 06:38:24 +00:00
jenkins-bot
f3be5c0ad6 Merge "resourceloader: Document optimisation in WikiModule::isKnownEmpty" 2022-02-24 06:12:21 +00:00
Elliott Eggleston
c83b530f95 Revert "Show message fallback keys when using &uselang=qqx"
This reverts commit 11d7d97768.

Breaking fundraising banners with regexes in them.

Bug: T302469
Change-Id: I0146a6a2907ca72792375e97a5b5392c6465614f
2022-02-23 21:21:45 -05:00