Commit graph

6010 commits

Author SHA1 Message Date
jenkins-bot
95dc4cba41 Merge "Correct API documentation for action=parse&prop=headhtml" 2019-03-21 14:36:02 +00:00
Roan Kattouw
1da7573bb7 WatchedItemStore: Use batching in setNotificationTimestampsForUser
Update rows in batches, using the same logic as is used by
removeWatchBatchForUser().

Also remove the functionality for updating all rows, and move that to
resetAllNotificationTimestampsForUser() instead. To that end, add a
timestamp parameter to that method and to the job it uses, and make
setNotificationTimestampsForUser() behave like a backwards-compatibility
wrapper around resetAllNotificationTimestampsForUser() when no list of
titles is specified.

Bug: T207941
Change-Id: I58342257395de6fcfb4c392b3945b12883ca1680
Follows-Up: I2008ff89c95fe6f66a3fd789d2cef0e8fe52bd93
2019-03-21 04:41:42 +00:00
Thalia
520dbe677a Check whether a user is blocked from upload in ApiUpload
Partially blocked users are not blocked from uploading, so check
explicitly whether a user is blocked from uploading, rather than
simply whether they have a block.

Bug: T217255
Change-Id: I21089a90202941ec3bc5bdbf9c0d2e7cab00b365
2019-03-20 22:19:02 +00:00
Translation updater bot
1fd35bc924 Localisation updates from https://translatewiki.net.
Change-Id: I213ca5e0b1b5fc1bfb666d1246086b3ed5f2866b
2019-03-20 21:56:08 +01:00
Translation updater bot
52dcc1ebcd Localisation updates from https://translatewiki.net.
Change-Id: I1b714edba904187e6b39f9e26f54b40f567453e7
2019-03-19 21:54:09 +01:00
jenkins-bot
a510a1c50d Merge "Remove many references to db fields being retired as part of MCR Schema Migration" 2019-03-19 18:09:30 +00:00
Bill Pirkle
f7afe42713 Remove many references to db fields being retired as part of MCR Schema Migration
Remove many references to database fields rev_text_id and ar_text_id,
which are being retired as part of MCR Schema Migration.
Some references remain, and will be removed under other patchsets
or other tasks.

Bug: T198341
Change-Id: Id044b8dcd7c9d09d5d6037eb732f6a105933f516
2019-03-19 10:50:54 -05:00
Translation updater bot
33b019140f Localisation updates from https://translatewiki.net.
Change-Id: I7dea9fd7d9892ea16a33bf020f22957dbe29549c
2019-03-18 22:55:11 +01:00
Translation updater bot
f9640e0ab4 Localisation updates from https://translatewiki.net.
Change-Id: I2d4ac09f82c79444730cf9cf0c8f01fc5109b917
2019-03-17 21:54:44 +01:00
brendajerop
008b638e93 Correct API documentation for action=parse&prop=headhtml
The documentation stated that action=parse&prop=headhtml gives the
<head> element of the page, yet it returns the doctype, opening <html>,
<head> element, and opening <body> tag.

Bug: T139567
Change-Id: I864d53239c8f00a7e524d8ffb659f02dae957b03
2019-03-15 20:41:52 +00:00
jenkins-bot
258d449719 Merge "Avoid a few overly complicated is_null() checks" 2019-03-13 22:23:50 +00:00
Andrew Otto
8f9a19e36e ApiMain.php api/request logging event changes
- Use 'Z' UTC timezone on dt
- Don't provide empty arrays if no data entries
- No need to set X-Request-Id in http.request_headers, it is meta.request_id

Bug: T214080
Bug: T212529
Change-Id: I37aa41a46ce74b372070e88a2f4da746fcbe2449
2019-03-12 16:23:19 +00:00
Thiemo Kreuz
d1a497a9f4 Avoid a few overly complicated is_null() checks
We can use the ?? syntax introduced with PHP 7.0 because it is already
supported by HHVM, even when HHVM is set to be compatible with PHP 5.6.

This was inspired by Ib117e05.

Change-Id: If980839fe6f86f2b4e86bbe99905a796e4708c7c
2019-03-11 10:29:20 +01:00
jenkins-bot
90f5b55fa4 Merge "ApiQueryLogEvents: Add IGNORE INDEX to avoid MariaDB optimizer bug" 2019-03-08 23:12:20 +00:00
jenkins-bot
b231efb408 Merge "Make ApiStashEdit use a separate key for the parser output due to size" 2019-03-07 23:58:57 +00:00
Aaron Schulz
1e4bf35253 Normalize "LEFT OUTER JOIN" to "LEFT JOIN" in SQL queries
Change-Id: I4de7f0527d9e16f9128ef3b24567511d4c74245d
2019-03-06 14:01:20 -08:00
Aaron Schulz
cb15755e92 Normalize use of "INNER JOIN" to "JOIN" in database queries
The ANSI SQL default join type is INNER and this might save
some line breaks here and there.

Change-Id: Ibd39976f46ca3f9b71190d3b60b76ca085787a00
2019-03-06 09:17:30 -08:00
Aaron Schulz
0dc015c87b Make ApiStashEdit use a separate key for the parser output due to size
Bug: T204742
Change-Id: Ibab189c8e0dee5e840770bdb0336516fdfc75e4b
2019-03-06 09:11:07 -08:00
Brad Jorsch
0ccc692012 API: Avoid duplicate logs to api-feature-usage
It can wind up logging deprecations twice if extractRequestParams() is
called with different values for 'parseLimit', for example.

Change-Id: I921777089fb8cfb4339af6fd08ee3475ed31b7f6
2019-03-05 17:56:55 -05:00
jenkins-bot
309c7b316f Merge "resourceloader: Remove addModuleScripts, and deprecate getModuleScripts." 2019-03-05 18:54:38 +00:00
Timo Tijhof
c6f3440832 resourceloader: Remove addModuleScripts, and deprecate getModuleScripts.
The addModuleScripts() methods were deprecated in 1.31 and 1.32,
these are now removed.

The getModuleScripts() are now deprecated as well, always returning
an empty array. To be removed in 1.34.

Depends on commits for bundled/wmf-deployed extensions that
remove the last few remaining callers to the deprecated functions
in: 3D, Collection, Flow, GlobalUserPage, and Wikibase.

Bug: T188689
Depends-On: If9f0bc6aef85117587fa1929f34f8861c8d80314
Depends-On: Ia8d41b97fbf6822f5f8f7ac889408acce1ac9a3a
Depends-On: I503b919739ea474ff33726815b0da55e2f7e2724
Depends-On: I236ef637fd03b810a46eb361e25067a037e9d183
Depends-On: I62e17779753b977a452cc0c9694947941e999cc3
Change-Id: I5a19b8f164ccf666485d2971202194b747f882df
2019-03-05 16:54:08 +00:00
Ottomata
ca3ff24560 Merge "Set api-request log http.request_headers properly" 2019-03-04 21:41:55 +00:00
Andrew Otto
e453a7b33f Set api-request log http.request_headers properly
$request->getHeader( 'Api-user-agent' ) was returning false,
and we can only accept string header values.

Bug: T214080
Change-Id: I3de8a455ad7dab9e3a67e24439e95f4968c93243
2019-03-04 16:12:39 -05:00
Brad Jorsch
e6021abc9c ApiQueryLogEvents: Add IGNORE INDEX to avoid MariaDB optimizer bug
The optimizer in MariaDB 10.1.37 and 10.1.38 seems to wildly
underestimate the cost of using the `times` index and overestimate the
cost of using the `user_time` or `actor_time` indexes, leading to it
choosing a plan that may have to fetch and filesort 10000000s of rows
versus the 10s or 1000s fetched with no filesort if it used the correct
index.

We can get it to use the correct index by having it ignore `times`, and
this also won't interfere with it choosing `log_user_type_time`,
`log_actor_type_time`, or other more specific indexes in cases where
those would be more appropriate.

As usual, this should be reviewed as MySQL/MariaDB versions used are
updated and removed if the optimizer is fixed.

Bug: T71222
Change-Id: I16dba2158865917e763722a5848cb5d483bf1a0b
2019-03-04 10:51:32 -05:00
jenkins-bot
9c820c9222 Merge "API: Handle Messages in errorArrayToStatus()" 2019-03-04 05:24:05 +00:00
Brian Wolff
0364f852a3 Various fixes to make phan-taint-check happier
Bug: T216348
Change-Id: If4071e689f476d2138d8964598c5a02b09448677
2019-03-04 03:24:44 +00:00
Brad Jorsch
426df4cd70 API: Handle Messages in errorArrayToStatus()
Two bugs here:
* If the error array contains an entry using a Message object instead of
  a string as the key, it'll blow up trying to do
  `self::$blockMsgMap[$error[0]]`.
* If the error array contains a Message object not wrapped in an array,
  it'll blow up trying to do `...(array)$error`.

Bug: T217382
Change-Id: I2a08e02bca0fb194416b3f2e6a1d6192d5c13cb2
2019-03-01 09:53:01 -05:00
jenkins-bot
6daa17a2a0 Merge "Remove comments literally repeating the next line of code" 2019-03-01 02:37:27 +00:00
Brad Jorsch
6a28fb3ace API: Use log context for api-feature-usage log
The text message is deprecated.

Bug: T217162
Change-Id: Ie891257140ea19369e10b2e91463a1fb4aa5d233
2019-02-27 17:06:02 -05:00
Thiemo Kreuz
37b3383e8b Remove comments literally repeating the next line of code
I would argue that these comments do not add any information that
would not be there already. Having them adds mental overhead, because
one needs to read both the comment and the next line of code first to
understand they say the exact same. I don't find this helpful, but
more distracting.

Change-Id: I39c98f25225947ebffdcc2fd8f0243e7a6c070d7
2019-02-27 17:28:40 +00:00
Petr Pchelko
a2b85209e2 Emit new style API action logs into Monolog.
Bug: T214080
Depends-On: I454d3d12dcc1d7e525dc468df90424e68df59d78
Change-Id: Id0be845884cd834d89df897cc8a862904caeb09a
2019-02-26 17:40:57 +00:00
Translation updater bot
b75bdf543c Localisation updates from https://translatewiki.net.
Change-Id: Id54b521705d09e65558ed7ce20f67280c7eac13d
2019-02-25 22:46:15 +01:00
jenkins-bot
ecbe578005 Merge "Return the page_id in list=langbacklinks as an int" 2019-02-25 02:45:42 +00:00
Reedy
93de72d9ae Return the page_id in list=langbacklinks as an int
Bug: T216968
Change-Id: I5b16779be7b24b1e46d4787a82a8daa3611f67b1
2019-02-25 01:05:44 +00:00
Reedy
4691389fa4 Use (int) rather than intval()
Bug: T216969
Change-Id: I4c06716c83b69d128f26fa7f68736808aa2d3d64
2019-02-25 00:38:33 +00:00
setian
8b8cc02ed7 Return the page_id in list=iwbacklinks as an int rather than string
Bug: T216968
Change-Id: I6645c5f1c6e76be3187c24053ed430e99c03bff4
2019-02-24 19:15:50 -05:00
Translation updater bot
09f85412af Localisation updates from https://translatewiki.net.
Change-Id: Iaa33d306da2a1daf0f99f7432b542f7bdbd72eca
2019-02-24 22:23:34 +01:00
jenkins-bot
2fe05dcf9d Merge "ApiQueryUserContribs: Only use 'contributions' replica if querying by user ID" 2019-02-22 03:58:47 +00:00
Translation updater bot
b1e9533cf7 Localisation updates from https://translatewiki.net.
Change-Id: Ibb1121f0765cd41ba7f8b6cfafb6e88d30021820
2019-02-21 21:55:49 +01:00
Brad Jorsch
fe65f68588 ApiQueryUserContribs: Only use 'contributions' replica if querying by user ID
When querying by user name or actor ID, the partitioning on the
'contributions' replicas makes things worse rather than better.

Bug: T216656
Change-Id: Ib4caf19d8fad64c527dee99667e425fd3e4b1a16
2019-02-21 11:47:11 -05:00
Brad Jorsch
c073e531cf API: Spread autoblocks from action=edit and action=move
The code in EditPage and SpecialMovepage does this primarily in web UI
code paths that aren't called by the API. EditPage also has a check in
the internal code path used by the API, but ApiEditPage runs its own
permissions check first and won't reach that code path.

Bug: T216245
Change-Id: I6263c8b60a24f3195dba583463f1ce4b004f82f5
2019-02-19 17:34:48 -05:00
Brad Jorsch
ace0338421 API: Add block info to more block errors
When using ApiBase::errorArrayToStatus(), block info was added to
'blocked' errors. But when using dieStatus() with a Status object
returned by core MediaWiki code, block info was not being added.

Change-Id: I14887b6dd76d665055283945b956b2e26c521ed5
Depends-On: Ie3addf53ab5fabf1c24e1033b58e63927f4e21bf
2019-02-19 17:34:48 -05:00
Translation updater bot
5b34aaecf1 Localisation updates from https://translatewiki.net.
Change-Id: I2316460e88bc758daa875638518105524f97ea1d
2019-02-17 21:55:23 +01:00
Bill Pirkle
d993f499ee Refactor calls to deprecated function Content::getNativeData()
Function Content::getNativeData() was deprecated.  Replace with
calls to new function TextContent::getText() in most places.

Bug: T155582
Change-Id: I2bd508c72aac4faf474ba45ab1f92e2e8d2eb9be
2019-02-15 17:48:01 +00:00
Translation updater bot
ff75ea4f05 Localisation updates from https://translatewiki.net.
Change-Id: Ic40eaf0cedbbf6a81585f4f0d686f4aa3ae7d160
2019-02-14 22:05:28 +01:00
Translation updater bot
e36ef661d9 Localisation updates from https://translatewiki.net.
Change-Id: Ia27cd1dfe1e1fecdff6431841c9e26a2daf3a865
2019-02-12 21:54:12 +01:00
jenkins-bot
9eafd89011 Merge "Prevent fatal PHP errors when PageRestriction::getTitle() returns null." 2019-02-12 16:27:04 +00:00
jenkins-bot
982d2c6e62 Merge "API: Don't return a deprecation warning for default values" 2019-02-07 22:03:09 +00:00
jenkins-bot
f9c735e3ed Merge "build: Updating mediawiki/mediawiki-codesniffer to 24.0.0" 2019-02-07 21:50:47 +00:00
Translation updater bot
c208e10de2 Localisation updates from https://translatewiki.net.
Change-Id: I36b74b2277e53dceeb60a3662eb14da9fa4f0589
2019-02-07 22:04:39 +01:00