Commit graph

7959 commits

Author SHA1 Message Date
Translation updater bot
19d3e5d5c6 Localisation updates from https://translatewiki.net.
Change-Id: If4279c616580689a6d9563ae5f776135416f9283
2023-01-27 08:03:06 +01:00
jenkins-bot
12ab56de15 Merge "Replace some usages of MWException" 2023-01-26 14:05:47 +00:00
Translation updater bot
f4cbc75b2e Localisation updates from https://translatewiki.net.
Change-Id: I7ce51da1a06be9de452eb0543dd29e986f5dfa1f
2023-01-26 08:11:52 +01:00
Daimona Eaytoy
c5a01d4b2e Replace some usages of MWException
These exceptions are not documented with @throws and they're really not
meant to be caught.

Bug: T86704
Change-Id: I07f32e42c6fd4bc8785bac91547858f15a9fc2a8
2023-01-26 00:10:34 +00:00
James D. Forrester
af2c582789 API i18n: Add {{PLURAL:}} for byte count messages
Change-Id: I59db4b48189a4f3286c5d08f62961305468ea771
2023-01-24 17:36:19 -05:00
Translation updater bot
012095055e Localisation updates from https://translatewiki.net.
Change-Id: Id1b5ec00528bda9e75acc9adf846f002c35fe845
2023-01-24 08:28:28 +01:00
Translation updater bot
09501bf19b Localisation updates from https://translatewiki.net.
Change-Id: Ifd9ef53d48828338888600c8d411db4c299a3630
2023-01-23 08:02:18 +01:00
Reedy
96bc83cdb8 api/en.json: api-help-datatype-expiry add missing 'may'
Change-Id: Id1ad2610130390ad033931f4db349f28272dee61
Follows-Up: If8f0df059eafb73ec9f39cc076b3a9ce2412d60a
2023-01-22 02:12:58 +00:00
Emitewiki2
f1420bf5b9 API: Make continue parameter help description more specific
Add links to more detailed help for the continue parameter.
[[API:Continue]] is currently a redirect to the existing continuation
documentation, but may be expanded to a full page given how
important continuation is to API usage.

Change-Id: I4b26e786371d941deea25c1f0c403e0c5783596f
2023-01-21 05:54:09 +00:00
Func
ce41bdd521 ApiOptions: Give warning if the value is too long
I was thinking add validations to HTMLApiField and other field types
if any, but then I found one field type that hard to implement proper
length validation, which is used for the `email-blacklist` preference.

The API will not save options that exceed the limit after this patch,
as if the validation is done by respective html fields.

Bug: T326696
Change-Id: Ib6b04db33bc6a806a49a16a1797c191faf5fb59d
2023-01-20 14:35:25 +08:00
jenkins-bot
8220c7dce3 Merge "Generate/set/get TOCData/SectionMetadata objects instead of arrays" 2023-01-19 21:36:56 +00:00
Subramanya Sastry
d8d6ecd39f Generate/set/get TOCData/SectionMetadata objects instead of arrays
* ParserOutput::setSections()/::getSections() are expected
  to be deprecated. Uses in extensions and skins will need to be
  migrated in follow up patches once the new interface has stabilized.

* In the skins code, the metadata is converted back to an array.
  Downstream skin TOC consumers will need to be migrated as well
  before we can remove the toLegacy() conversion.

* Fixed SerializationTestTrait's validation method
  - Not sure if this is overkill but should handle all future
    complex objects we might stuff into the ParserCache.

* This patch emits a backward-compatible Sections property in order to
  avoid changing the parser cache serialization format. T327439 has
  been filed to eventually use the JsonCodec support for object
  serialization, but for this initial patch it makes sense to avoid
  the need for a concurrent ParserCache format migration by using a
  backward-compatible serialization.

* TOCData is nullable because the intent is that
  ParserOutput::setTOCData() is MW_MERGE_STRATEGY_WRITE_ONCE; that is,
  only the top-level fragment composing a page will set the TOCData.
  This will be enforced in the future via wfDeprecated() (T327429),
  but again our first patch is as backward-compatible as possible.

Bug: T296025
Depends-On: I1b267d23cf49d147c5379b914531303744481b68
Co-Authored-By: C. Scott Ananian <cananian@wikimedia.org>
Co-Authored-By: Subramanya Sastry <ssastry@wikimedia.org>
Change-Id: I8329864535f0b1dd5f9163868a08d6cb1ffcb78f
2023-01-19 16:18:13 -05:00
Translation updater bot
365b209d6d Localisation updates from https://translatewiki.net.
Change-Id: I0482fb4e84f4c42f8d416a7523695f9f050524b5
2023-01-19 10:56:08 +01:00
jenkins-bot
8080471cb7 Merge "API: Allow use of multivalue parameter documentation for templates" 2023-01-18 10:01:32 +00:00
Translation updater bot
25a5c51680 Localisation updates from https://translatewiki.net.
Change-Id: Ia6b56a4c95f1dfd293dd5da7a5ef9bd70a9fddc9
2023-01-18 08:11:36 +01:00
Gergő Tisza
7c03a6f331
API: Allow use of multivalue parameter documentation for templates
Allow the use of PARAM_HELP_MSG_PER_VALUE for PARAM_TYPE='string'
and PARAM_ISMULTI=true, which is the setting used for templated
parameters (PARAM_TEMPLATE_VARS).

It's common for templated parameters to take the variable parts
of the name from some fixed set, but they are required to use
PARAM_TYPE=string so it makes sense to allow the use of multi-
valued parameter documentation for that case.
The other option would have been to allow templated parameters
to be enums, which also makes sense and could be a complimentary
improvement; there are two reasons to prefer the current approach:

* Getting the list of allowed values might have a performance
  impact that we only want to incur when the (optional) parameter
  is used, while an enum requires the value list to be generated
  every time the API module is used. So there would be some
  value in using string type for templated parameters with a
  known set of documentable values even if enum were also allowed.
* Per-value documentation might be useful outside the template
  use case for non-restricted multi-valued strings: maybe all
  values are allowed but there are some values with special
  meanings that are worth documenting.

Change-Id: I53f9ae840c0a7eee76c4b57f95390b5045707efd
2023-01-17 21:21:22 -08:00
Translation updater bot
cf939592af Localisation updates from https://translatewiki.net.
Change-Id: Iaba0e6b3caa1c2045fb2fe4be76a05b0e830c46a
2023-01-17 07:54:09 +01:00
Translation updater bot
62c462df00 Localisation updates from https://translatewiki.net.
Change-Id: I63f2b44f1b1b5dfe0ef12d2606eecb5b5aa3d6a1
2023-01-16 08:08:41 +01:00
Translation updater bot
109383796e Localisation updates from https://translatewiki.net.
Change-Id: Ibb67b36acba77380539b85417e7d8347995fe3b8
2023-01-13 08:09:31 +01:00
Translation updater bot
a5a59c1366 Localisation updates from https://translatewiki.net.
Change-Id: I48dc20cb3d7d6e0a5e1b5ceb2bcb34a28a345f63
2023-01-11 08:46:30 +01:00
Translation updater bot
357ff4006b Localisation updates from https://translatewiki.net.
Change-Id: I13aee3728b2ba03512c3b1d5e3b1bee72e9fdf63
2023-01-10 08:10:22 +01:00
Translation updater bot
afc1973125 Localisation updates from https://translatewiki.net.
Change-Id: I15a1e4cf119fbef63c411eeba89223dbadbc3574
2023-01-09 08:43:54 +01:00
Translation updater bot
a2b31a9243 Localisation updates from https://translatewiki.net.
Change-Id: I831336cdef6b999550f02ec15d58472bff4fad21
2023-01-06 09:37:28 +00:00
Translation updater bot
c17a323452 Localisation updates from https://translatewiki.net.
Change-Id: I30393ed90373220926aaa4d15dbe8d485ba2ce48
2023-01-04 08:13:21 +01:00
Timo Tijhof
4ef0891994 rdbms: Consolidate logger channels into one
Notable changes:

* In SqlBagOStuff::getConnectionFromServerInfo, only two loggers were
  injected. The rest implicitly got a NullLogger due to being absent.
  These are now effectively unsilenced.

* Database::__construct() required almost all parameters, even the
  loggers. I've wanted to move some of DatabaseFactory into the ctor
  here for a while. In order to make this change not a breaking
  change, the new 'logger' parameter is optional with NullLogger as
  default. This allowed some of the test cases, which were simply
  passing NullLogger, to be fixed by passing nothing instead of
  passing the new option name.

  The Database class is behind a dozen layers of indirection for
  real use, so this will still be injected just fine (DBF, LB, LBF,
  MWLBF, etc.).

* In LegacyLogger, the handling for $wgDBerrorLog was previously
  limited to DBConnection and DBQuery. This now includes errors
  from other (generally, newer) parts of Rdbms as well, which were
  previously missing.

  This only affects sites (typically CI and dev setup) where
  $wgDBerrorLog is used, as opposed to the more common
  $wgDebugLogGroups by-channel configuration.

* TransactionProfiler gets its logger injected in a rather odd way,
  via entrypoints (MediaWiki.php, ApiMain.php, and MaintenanceRunner)
  as opposed to service wiring. This is kept as-is for now.

* In LBFactoryTest, in particular testInvalidSelectDBIndependent2,
  there are cases that intentionally produce failures of which
  the result is then observed. In CI we assert that dberror.log is
  empty so instead of adding the missing logger fields to that
  LBFactory instance, the only one set (replLogger) is removed.
  The alternative is to set 'logger' now, which would naturally
  cause CI failures due to unexpected entries coming through to
  non-mocked error log.

Bug: T320873
Change-Id: I7ca996618e41b93f488cb5c4de82000bb36e0dd3
2023-01-03 22:46:38 +00:00
jenkins-bot
c30165f535 Merge "Split a base class out of CommentStore" 2023-01-02 15:01:04 +00:00
Translation updater bot
1a03b63d37 Localisation updates from https://translatewiki.net.
Change-Id: Ib2c5847801b89102591977ce03ded74d8f73fe4e
2023-01-02 08:21:46 +01:00
Alexander Vorwerk
f6bd18d6c2 Split a base class out of CommentStore
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication

basically the comment store version of I3a6486532f2ef36

Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
2023-01-01 22:34:36 +00:00
Umherirrender
ade5816751 Use LanguageNameUtils::AUTONYMS/SUPPORTED instead of hard coded value
Easier to spot the documentation what happen with this option

Change-Id: I6764dff8f79a6e667a0f4f61336f6280c7f13ed2
2022-12-29 13:47:29 +01:00
thiemowmde
8b49357b25 Replace some tivial ??= with even more trivial ??
Patch Ifa7a9bc replaced some longer `=== null` constructs with the
new ??= operator we have since PHP 7.4. However, some of these can be
simplified even more with the ?? operator we have since PHP 7.0.

Follow-Up: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
Change-Id: I7b05e723810558bb5437adc97eab54ca04d38c06
2022-12-23 08:35:44 +01:00
Translation updater bot
fbbc7dce7f Localisation updates from https://translatewiki.net.
Change-Id: I26ce0eb0c59fbdf1b78cc63f1b0e4fcfbe2b40c1
2022-12-23 08:21:22 +01:00
Translation updater bot
e209612e9c Localisation updates from https://translatewiki.net.
Change-Id: I86be77310e9ac104705ff99bbfd9653cea22b13f
2022-12-22 10:26:16 +01:00
Translation updater bot
84ce5bd66a Localisation updates from https://translatewiki.net.
Change-Id: Ib21fd530a7a3a1497b0d2ca0ed92ff489fd64676
2022-12-21 08:56:33 +01:00
jenkins-bot
293f8dfba8 Merge "Make use of ??= in more places" 2022-12-21 00:33:46 +00:00
Translation updater bot
db6fadf577 Localisation updates from https://translatewiki.net.
Change-Id: I50785f86f6803193939253076be0f3637b1987e3
2022-12-20 09:12:28 +01:00
Translation updater bot
4032dd1df9 Localisation updates from https://translatewiki.net.
Change-Id: Id53af6a076ee410d89cbeef513e45cf35d964742
2022-12-19 08:45:46 +01:00
jenkins-bot
e3fa838eb1 Merge "api: Convert cl_timestamp format for continue on categorymembers" 2022-12-17 15:10:15 +00:00
DannyS712
c1db64b808 Make use of ??= in more places
New feature from PHP 7.4

Change-Id: Ifa7a9bc7b2ec415ad7ecb23f4c1776f51f58fd6b
2022-12-17 01:10:13 +00:00
jenkins-bot
781d9f23e2 Merge "api: Migrate subquery to use SelectQueryBuilder in ApiQueryAllUsers" 2022-12-16 20:14:51 +00:00
Amir Sarabadani
afdfc687c8 api: Migrate subquery to use SelectQueryBuilder in ApiQueryAllUsers
Bug: T311866
Change-Id: I1d65c9722ce409ce8518eb5e5707fa112a4a5d36
2022-12-16 19:15:44 +01:00
Umherirrender
8a67369719 api: Convert cl_timestamp format for continue on categorymembers
The validation added with 75ec894 expect the timestamp of the continue
paramter in the database format, which is not true for cl_timestamp
under mysql, because that is a real timestamp datatype on the database
(T283461)

Using IDatabase::timestamp to use the correct format on postgres as well

Bug: T323910
Follow-Up: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
Change-Id: I5372ee4b56e97f20d2431acae84438b8687a5361
2022-12-16 16:50:37 +01:00
Amir Sarabadani
cb18d1007e Reorg: Move ActorMigration and ActorMigrationBase to user/
This may seem a bit weird but anything else related to actor is already
under user/ including ActorCache, ActorNormalization, ActorStore and
ActorStoreFactory.

Bug: T321882
Change-Id: I7072b374bba7a0cd9d905e399c822bf30bd5c0d8
2022-12-16 13:44:33 +01:00
Amir Sarabadani
523ab7cff8 Reorg: Move RawMessage to under language/
To follow Message. This is approved as part of RFC T166010.

Also namespace it but doing it properly with PSR-4 would require
namespacing every class under language/ and that will take some time.

Bug: T321882
Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18
2022-12-16 11:30:19 +01:00
Translation updater bot
943ab1e89d Localisation updates from https://translatewiki.net.
Change-Id: I40b0ed0dcc338dcb41a2e96507ac85e59afd13f8
2022-12-16 08:27:29 +01:00
jenkins-bot
c903124b77 Merge "Make use of ?:, ?? and ??= operators in mostly trivial cases" 2022-12-16 02:51:26 +00:00
jenkins-bot
26281987e9 Merge "api: Replace deprecated Linker::formatComment" 2022-12-15 23:33:12 +00:00
Translation updater bot
e3a6741ec1 Localisation updates from https://translatewiki.net.
Change-Id: Ia3feca85f1ca6a22830008e3094ac44fba3dd490
2022-12-15 11:04:04 +01:00
Umherirrender
fd516a98e1 Fix whitespaces after comma
Change-Id: Ide6de0a53661e6f650099d7b1f274a02699441df
2022-12-15 01:24:14 +01:00
Translation updater bot
cb31e2ae19 Localisation updates from https://translatewiki.net.
Change-Id: Ifc127d8962545913e2f4f63197db05df05dfcccc
2022-12-14 08:01:36 +01:00
jenkins-bot
06c79bc445 Merge "Parse API should not include #mw-content-subtitle element" 2022-12-14 04:09:51 +00:00