Commit graph

110290 commits

Author SHA1 Message Date
jenkins-bot
35ed597d6f Merge "Revert "Tombstone the old session on SessionBackend::resetId()"" 2022-06-01 17:01:18 +00:00
jenkins-bot
203e12d3a3 Merge "Revert "ParserTestRunner: undo class rename of TestFileReader"" 2022-06-01 16:51:51 +00:00
Winston Sung
934c922686 Rearrange zh-related language fallback chain
Update language fallback chain to zh-hans <=> zh-hant bidirectional to prevent adding translation
duplicates in zh and zh-hans.
Add en magic words in zh message file to prevent fallback to translations of language variants.

Bug: T286291
Bug: T296188
Bug: T252367
Bug: T278639
Related: I484d4cba1e16fce0f7c433a865f3acf676b818c1
Related: Idf39310b4b66f9c5f210d1717e0e47b9e598c13c
Change-Id: I3b30303118ae8cd87dc5f2016372f0de89a7b075
2022-06-01 13:41:10 +00:00
diesel kapasule
e908b23627 Adding log links for deletion and protection to ChangesList
Add action links for deletion and protection on Changeslist.php.
This will make links more consistent with the log page entries.

Bug: T49466
Change-Id: Ic1fdb2b4280bdeac521323aafe4548819778c870
2022-06-01 09:56:45 +00:00
Dayllan Maza
d1d519c561 DeleteAction: Show warning when subpages are present
When deleting a page/file:
* Show warning when a file talk page has subpages
* Fix link to Special:PrefixIndex so that only the subpages
  are listed

Follow-Up: I5660540f11b9ec74d573684f5d70266ca0df95b5
Bug: T305268
Change-Id: Ia500c79ad09bda4d03f9a172c7ae35ce1665e073
2022-06-01 08:08:07 +00:00
Translation updater bot
58f4cc7e3f Localisation updates from https://translatewiki.net.
Change-Id: I2823cb430ec24e5b63bc66b53148211ef8084400
2022-06-01 08:08:59 +02:00
Subramanya Sastry
3e22c5b975 Revert "ParserTestRunner: undo class rename of TestFileReader"
This reverts commit 123f785cdf.

Reason for revert: This breaks parserTests.php script since the ParserTestRunner script has references to both TestFileReader classes and this patch ends up using the same reader everywhere.

Change-Id: I22bdd05f9a86674e88335cc9055f1ce6cfa128d1
2022-06-01 00:00:19 +00:00
Aaron Schulz
496332e4ce rdbms: avoid DBReadOnlyRoleError in Database::doFlushSession()
Fix and simplify the flags to executeQuery(). The QUERY_CHANGE_ROWS flag
caused the DB_REPLICA role check to be violated.

Remove the UNLOCK TABLES query since lockTables()/unlockTables() have
since been removed.

Bug: T306632
Change-Id: I8fcf940028abd70c0d66bec1780308d3c2367b61
2022-05-31 23:09:41 +00:00
jenkins-bot
0bacedd339 Merge "Make "title" the first field in a form, when needed" 2022-05-31 20:48:35 +00:00
jenkins-bot
0ae3b81c21 Merge "resources: Reorder css in mediawiki.interface.helpers.styles" 2022-05-31 20:39:11 +00:00
jenkins-bot
796dd9fdd9 Merge "Show change tags on Special:MergeHistory" 2022-05-31 19:05:08 +00:00
jenkins-bot
254bc1fb1f Merge "Add put() and delete() shorthands to rest.js" 2022-05-31 18:51:25 +00:00
Umherirrender
3d23156445 Show change tags on Special:MergeHistory
The order in the result row is build using a message,
which needs the new parameter in the english message text.

The stylesheet mediawiki.interface.helpers.style is needed to show
parenthesis around the tags. It also adds parenthesis to the "bytes",
makes the comment in italic and format revision deleted information in
strike-grey.

Bug: T309647
Change-Id: I1fb481e6e62372874e3c65ec5e4cebf17291217f
2022-05-31 18:00:08 +00:00
Daimona Eaytoy
14ae7c3f77 Add put() and delete() shorthands to rest.js
These methods are not uncommon in a REST framework, so it'd be useful to
have a shorthand for them.

Add QUnit tests, copying the one for post().

Note that the REST framework actually ignores the request body for
DELETE requests, but we may want to change that (T309388), and so it is
supported here.

Change-Id: I9a4372314be1785c2124be354bd4151d595b6260
2022-05-31 17:26:17 +00:00
Umherirrender
2ca04910bc resources: Reorder css in mediawiki.interface.helpers.styles
Group all comments things and all revdel things together

Follow-Up: I7dedebd3bce3b4aec127738edc81b180325f0836
Change-Id: I98cb2342059c54b8ad97e1efc1d90e0e563b408e
2022-05-31 18:51:54 +02:00
jenkins-bot
ff62deef6c Merge "Allow sharding in site_stats update" 2022-05-31 16:40:33 +00:00
Gergő Tisza
1f7561e59f Revert "Tombstone the old session on SessionBackend::resetId()"
This reverts commit ec3da4589bebeb46d7f1544dc46f24baec334966.
Caused frequent session loss in the Wikimedia cluster.

Bug: T299193
Bug: T309616
Change-Id: I3a410df88071d72078672cf1b670e81c11b28117
(cherry picked from commit d1a1fcedc9eace8a5f4a8454eff44a7ed898848a)
2022-05-31 16:37:31 +00:00
diesel kapasule
e37619873b Remove unused config $wgInterwikiPrefixDisplayTypes
Bug: T306361
Change-Id: Ic6e43d5bbca873dd27e9e2a1f2bc9d0c9a43dfa4
2022-05-31 17:14:20 +02:00
jenkins-bot
07f26c8efe Merge "Remove unused configuration global $wgLegacySchemaConversion" 2022-05-31 13:53:20 +00:00
Isabelle Hurbain-Palatin
a2e5997a4c Make "title" the first field in a form, when needed
In a default installation of Mediawiki, the article URLs use the URL GET
parameter "title" to construct the page title (index.php?title=Foo).
When a form is submitted, that parameter is added to the form as a
hidden field. Before this patch, it's added as last element of the form,
which makes the URL confusing. For example, when running a search on the
Lint errors, the URL becomes
index.php?pagename=Test&title=Special%3ALintErrors instead of starting
with title=Special:LintErrors as one would expect.
Note that this is not an issue on wikis that set their article path to
look like /wiki/Foo: in that case, the title of the page is not set as
a hidden field.

Change-Id: Id7c0617166754010cec987158e14ac54ddc94444
2022-05-31 09:46:08 +02:00
Translation updater bot
73d1885abe Localisation updates from https://translatewiki.net.
Change-Id: Ibacc3dff15ba65cbf893e6f0a87b4fad8bf661c1
2022-05-31 07:54:56 +02:00
jenkins-bot
d160b616f3 Merge "Docs: remove references to DefaultSettings.php" 2022-05-31 00:40:35 +00:00
Kosta Harlan
ff63886b0f
phpunit: Do not access MW services in dataProviders
We cannot access MW services in a data provider, as MW will not have
bootstrapped by this point in plain PHPUnit. And we do not want to
bootstrap MW by the time a dataProvider is executing, because unit tests
should not need (nor be able to access) MW services.

Change-Id: I21a5993f91b8fbe3fa476a8244b8911cf81e1d5f
2022-05-30 23:16:06 +02:00
daniel
7f8e3c5360 Docs: remove references to DefaultSettings.php
Bug: T300129
Change-Id: I1e83a0dde6235bed91d28d7d43691c6a5d979f2f
2022-05-30 21:27:09 +02:00
diesel kapasule
8a31497c5f Remove unused configuration global $wgLegacySchemaConversion
I removed $wgLegacySchemaConversion from config-vars and
HistoryBlobCurStub.

Bug: T303684
Change-Id: I7f918ab61ffea377bd827721f9b41ae5d8f82226
2022-05-30 20:59:05 +02:00
Amir Sarabadani
5156ae0404 Allow sharding in site_stats update
This would be useful in cases that lots of edits happen at the same time
and this would reduce the time waiting to get the row lock.

Bug: T306589
Change-Id: I3b869e3b85dfd66575390ef4247f2f81f19c878e
2022-05-30 20:46:08 +02:00
Amir Sarabadani
278c3dd230 ViewAction: Enable unconditional 1h hour CDN cache for any page views
Currently, MediaWiki avoids CDN caching if the URL is not among the list
of canonical URLs that we purge, which can cause all sorts of issues
including caching being extremely narrow.

ViewAction is cache invariant and better to be cached unconditionally.

This effectively undoes part of Ie38ae198b1735339371 (2012). Similar
to the existing setCdnMaxage() calls, this is not expected to risk
caching of private information given that a separate layer is
responsible for deciding whether caching is "safe" from an application
point of view. Callint setCdnMaxage() does not affect whether CDN
caching is allowed, its just that the default maxage is 0 for cases
where it is safe, and this change effectively raises it to 1h for
arbitrary URLs that effectively route to action=view, including e.g.
diff URLs and oldid URLs, but e.g. not any other action parameters.

Bug: T309063
Change-Id: I468caa8fd4baf650b419572b77b3df64ae72780d
2022-05-30 18:16:26 +00:00
jenkins-bot
54a77f0f7c Merge "Rest: Collect stats on Cache & Stash usage" 2022-05-30 15:21:10 +00:00
jenkins-bot
3a436a8f1f Merge "Localisation updates from https://translatewiki.net." 2022-05-30 14:04:22 +00:00
jenkins-bot
98882c31b2 Merge "SessionManage: Do not save when creating empty session" 2022-05-30 12:54:06 +00:00
Gergő Tisza
1682de5e83 SessionManage: Do not save when creating empty session
SessionBackend::save() results in the session provider unpersisting
when the session backend metadata is dirty (which is always true
for a new session). This breaks the tombstone mechanism introduced
in I3a76b67aa51159ebf0195db15cf7c34e00a64a2e: after the manager
refuses to load the tombstoned session, it will create an empty
session, and that will unpersist the session ID and log the user
out if the session ID was the only thing that kept them logged in.

Saving the session has two effects: the unpersisting (invalid
cookies are cleaned up) and saving the session data in in-process
cache (but not the real storage). The latter might cause an extra
session storage read per unauthenticated request, though in theory
it shouldn't as the SessionBackend itself gets cached so a new
session lookup only happens for a different WebRequest object.
Still, if it becomes a problem, we can just add some sort of
explicit cache warming step to empty session creation.

Skipping the unpersisting could mean that invalid (e.g. expired)
session cookies stick around and prevent the user from being
served from edge cache. But for non-tombstoned requests, as long
as there is a syntactically valid session ID and either no user
ID or a user ID pointing to a valid user, CookieSessionProvider
will return a non-null session info, and SessionManager will
reject it and unpersist; and CentralAuthSessionProvider behaves
similarly except for the case when there is no local session
cookie but there is a global session cookie on the second-level
domain. That seems a narrow enough edge case to ignore.

Bug: T299193
Change-Id: Ib34a84d1d3abbce4dcf7433b51abf6e694984c59
2022-05-30 12:32:47 +00:00
jenkins-bot
ef7956d7ea Merge "resourceloader: Improve internal type hints in FileModule class" 2022-05-30 11:23:40 +00:00
Derick Alangi
141b42c7ca Rest: Collect stats on Cache & Stash usage
As a means of understanding the usage of the stash FEAT for
/page/html & /revision/html endpoints used by VE extension,
this patch introduces the collection of stats using the
StatsDataFactory.

Bug: T309017
Change-Id: I4e17d50e79da263637bdd55ab62e993df441fe38
2022-05-30 09:51:55 +01:00
jenkins-bot
e46d36c658 Merge "Update Breton messages." 2022-05-30 08:00:07 +00:00
Translation updater bot
d2585a0fec Localisation updates from https://translatewiki.net.
Change-Id: I2356e57e88b2f97a219883f1667e3e6648da3ffa
2022-05-30 09:07:50 +02:00
jenkins-bot
9f5aeeb3ed Merge "mailmap: Update Zabe's entry" 2022-05-30 04:15:09 +00:00
jenkins-bot
551808d9eb Merge "objectcache: handle object tokens in MediumSpecificBagOStuff::doCas()" 2022-05-29 23:54:19 +00:00
Alexander Vorwerk
a5aa408ad2 mailmap: Update Zabe's entry
Change-Id: Ia0caa257c3597d781ccd1d2fff9b42ecaabe7e37
2022-05-29 23:52:32 +02:00
Timo Tijhof
85892edce5 resourceloader: Minor doc changes following PSR-4 namepace change
Follows Id08a220e1d60 (after I92998ae6a82e).

Change-Id: I33d20201bfee4595baa39c01eaf8b7de6034a8ed
2022-05-29 16:41:19 +00:00
Timo Tijhof
10805be34b resourceloader: Improve internal type hints in FileModule class
Follows-up I56a0ee74595404e1, I38a0761ae4633 and I6c3d186de1877f73d4.

Remove most "Usage" examples as these are internal and
mostly-normalized class fields. This is not where end-users should
look for documentation. Besides, many of the examples were wrong or
outdated, and almost all were incomplete. It also had an inherent
dilimma between describing all possible valid input and describing
what we actually store in that instance variable after normalization
in the class constructor. The usage docs have long been moved
to the MW config file, so we can omit that.

In its stead, place more complete and accurate type hints for Phan
to understand the possible code paths, in particular to reflect
the use of FilePath objects.

Change-Id: I1cc002f350785d3f46f79be5defb7b3cadbebf34
2022-05-29 16:41:09 +00:00
Umherirrender
f01a391f0d tests: Fix types in documentation by adding use statements
Some types used in @param/@return are not correct,
because the class is not used with namespace

Change-Id: Ic2643687378a6addabc2c9cd402224e442257f86
2022-05-29 07:11:15 +00:00
jenkins-bot
29878a3f71 Merge "api: Remove deprecated class alias ApiQueryContributions" 2022-05-29 07:10:16 +00:00
jenkins-bot
778494c6bf Merge "Remove deprecated MediaWiki\Storage namespace for revision related class" 2022-05-29 07:09:17 +00:00
jenkins-bot
3dba007822 Merge "content: Remove UnknownContent/UnknownContentHandler class alias" 2022-05-29 07:07:42 +00:00
Umherirrender
f07295ade1 content: Remove UnknownContent/UnknownContentHandler class alias
Renamed in a67cad6 in 1.36
The fallback content is designed for internal use only

Change-Id: I6977a9cf1eab0e701fd6969b1a2b5d1dfcecfdfa
2022-05-29 06:20:45 +00:00
Umherirrender
a2a1a4ecd2 Remove deprecated MediaWiki\Storage namespace for revision related class
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.

Bug: T305784
Change-Id: I48cdc65301a8cd20d2bedd031dbdae33b8c2a34d
2022-05-29 06:17:01 +00:00
Umherirrender
2f7c0d6166 api: Remove deprecated class alias ApiQueryContributions
Deprecated since 1.32

Change-Id: Ia4d2d01272175972f29a724c06c249bfeb522cfe
2022-05-29 06:15:38 +00:00
jenkins-bot
5337dfb013 Merge "fuzzTest.php: Simplify try/catch code" 2022-05-28 21:41:03 +00:00
Umherirrender
71974b4a3e language: Remove deprecated FakeConverter class alias
Deprecated since 1.35

Change-Id: If3f1eb881db9ebd89b39545285f0540e76ef62b6
2022-05-28 16:05:41 +02:00
Umherirrender
9832c7f9ba fuzzTest.php: Simplify try/catch code
Change-Id: I925dd6b6f18118c8c4c577795e373f73337851d6
2022-05-28 09:05:18 +02:00