Commit graph

105866 commits

Author SHA1 Message Date
jenkins-bot
5ebdc642fc Merge "Make EditPage use PageUpdater" 2021-09-16 20:55:33 +00:00
jenkins-bot
683495458e Merge "MediaWikiIntegrationTestCase::getExistingTestPage: Don't assume NS0 is wikitext" 2021-09-16 20:34:55 +00:00
daniel
6ce0d2c825 Make EditPage use PageUpdater
This ensures that a DerivedPageDataUpdater is initialized earlier during
the edit process, so it can be used by hooks to access the state of the
ongoing edit.

This patch also cleans up PageUpdater a bit to make the internal information
flow more consistent with the idea that PageUpdater is acting as a
builder for a new revision.

Change-Id: I99abb7bdffb2b5ff5979ba5b1e56d39dba4cd3dc
2021-09-16 13:11:15 -07:00
jenkins-bot
095803e28d Merge "Move revert detection code from WikiPage to EditResultBuilder" 2021-09-16 20:09:19 +00:00
Timo Tijhof
65b40721bd mediawiki.confirmCloseWindow: Remove support for custom 'message'
Between 2015 and 2016, all major browsers removed support for this
due to abuse by pop-up ads and such. As such, we're invoking the
client-side wikitext message parser before the onbeforeunload event
can return, but not actually using its string anywhere except in IE11.

Remove this and let IE11 do the same native thing as all other
browsers have been doing regrardless. This is not a breaking change,
because any callers to confirmCloseWindow() passing a 'message' option
will still work and create the same behaviour as before. It just means
that in IE11 the "extra text" message is now ignored the same as it
was in other browsers already.

Browsers correctly understood that virtually the only legitimate use
of this feature was to remind users of unsaved changes, and their
default localised prompt reflects that understanding.

* Update callers to not bundle and pass down a custom message.

* Keep the message bundled with confirmCloseWindow.js for use in
  the trigger() method. This no longer supports the override, but it
  does still need a default localised string there since this method
  uses a prompt() which unlike 'onbeforeunload' has no default.

  I have moved the message parsing down to that method to still remove
  its overhead from the most common code path.

Bug: T283193
Change-Id: I7b3c0579272f97243c9795c63d7193fefc3eddbe
2021-09-16 19:25:25 +00:00
Petr Pchelko
2c2ffb0bef Move revert detection code from WikiPage to EditResultBuilder
WikiPage is not the right spot to compute all the revert
related stuff - we already figure out manual reverts when
building the EditResult, lets figure out rollbacks and undos
in there as well.

Change-Id: I9fdc5f24c1db1eb0452b90bf4af1ef5ffbce6cb8
2021-09-16 12:24:34 -07:00
jenkins-bot
76fdc1fc91 Merge "Deprecate and replace legacy hooks in DeletePage" 2021-09-16 18:39:29 +00:00
jenkins-bot
880b49f9df Merge "Remove Article::delete() Article::confirmDelete() and ImagePage::delete()" 2021-09-16 18:33:35 +00:00
Daimona Eaytoy
377342de86 Deprecate and replace legacy hooks in DeletePage
In both cases the typehints were changed to the new interfaces. For the
ArticleDelete hook, the replacement has no $error param and requires the
caller to set a fatal status if it wants to abort.

Bug: T288758
Change-Id: I9540f6ab2075bcf56bd4fdc79c611c883246cdce
2021-09-16 19:13:35 +02:00
Daimona Eaytoy
30a4919717 Remove Article::delete() Article::confirmDelete() and ImagePage::delete()
All unused.

Bug: T288282
Change-Id: Ia07ddab8c0ec9b74e58e980798263f6b6685a31f
2021-09-16 19:10:55 +02:00
Alexander Vorwerk
111a7fd02d Update @since doc for WikiExporterFactory
The introduction got merged after 1.37 got branched.

Change-Id: I1c51e5c7910026f4834e7041b8ae781985fe422e
2021-09-16 19:10:46 +02:00
jenkins-bot
76ba780e41 Merge "WikiExporter: inject services" 2021-09-16 17:04:04 +00:00
jenkins-bot
fed59015ee Merge "RELEASE-NOTES-1.37: Re-write to prepare for rc.0" 2021-09-16 17:03:58 +00:00
jenkins-bot
4d5e08a979 Merge "Vue: Split off error logger into its own plugin" 2021-09-16 16:41:53 +00:00
jenkins-bot
ed13eb01c4 Merge "Update Special:Block UI" 2021-09-16 16:36:53 +00:00
James D. Forrester
092a3dde91 RELEASE-NOTES-1.37: Re-write to prepare for rc.0
Consistency of language, syntax, wording and styling. Or, at least,
a first stab at this.

Bug: T289590
Change-Id: I15d2c617419141e4c1d440c46806a3150d1b4ee0
2021-09-16 08:40:50 -07:00
Roan Kattouw
15e8d65b89 Vue: Split off error logger into its own plugin
Change-Id: Idbbaf2a5fb174aabefa9206d889c62c71846ac5f
2021-09-16 08:37:57 -07:00
jenkins-bot
5af89e32c7 Merge "Emit deprecation warnings reading from $wgUser" 2021-09-16 15:27:44 +00:00
jenkins-bot
a720ab41da Merge "Add slow-parsoid log channel" 2021-09-16 14:05:36 +00:00
Fomafix
bea70565d9 mediawiki.page.ready: Introduce wikipage.indicators hook
This new hook allows extensions and gadgets to enhance indicators on
page load and on live preview. This is useful for the Kartographer
extension.

The hook gets fired only if there is at least one indicator present.

The new hook gets fired before `wikipage.content` fires, to have the
same order like in the DOM.

Bug: T280363
Change-Id: I154ebbf049fbce1e872548651953adb1419b6cba
2021-09-16 13:11:04 +00:00
jenkins-bot
71d9aa661b Merge "ChangeTags: Add CSS classes to rows for hidden tags too" 2021-09-16 12:35:15 +00:00
Translation updater bot
cd32b1ae21 Localisation updates from https://translatewiki.net.
Change-Id: If1f6d261aa672e13e4a1ef91716aa67db572b9fe
2021-09-16 07:57:41 +02:00
DannyS712
a2b20b63d7 Emit deprecation warnings reading from $wgUser
With this patch deprecation warnings will be emitted
if $wgUser is accessed or written into. The only pattern
of usage still allowed is

$oldUser = $wgUser;
$wgUser = $newUser;
// Do something
$wgUser = $oldUser;

Once there is no deprecation warnings, we know that nothing
legitimately depends on $wgUser being set, so we can safely
remove the code that's still allowed as well.

Bug: T267861
Change-Id: Ia1c42b3a32acd0e2bb9b0e93f1dc3c82640dcb22
2021-09-15 20:17:04 -07:00
jenkins-bot
35bf2ef9e6 Merge "RELEASE-NOTES-1.37: Clarify recent skin footer deprecations" 2021-09-16 02:52:44 +00:00
jenkins-bot
28961d052a Merge "Remove FileBackendGroup::singleton() and ::destroySingletons()" 2021-09-16 02:52:38 +00:00
jenkins-bot
9f9040418a Merge "Remove MessageCache::singleton()" 2021-09-16 02:52:32 +00:00
jenkins-bot
906f66dc59 Merge "Remove LinkCache::singleton()" 2021-09-16 02:52:25 +00:00
jdlrobson
1be6af3823 RELEASE-NOTES-1.37: Clarify recent skin footer deprecations
Change-Id: I54f45cd5c37dc3f1b3b5233469c1791e28535451
2021-09-16 02:29:01 +00:00
jenkins-bot
adfa9a9503 Merge "resourceloader: Fix debug mode for RL-to-RL cross-wiki module loads" 2021-09-16 01:40:13 +00:00
Timo Tijhof
008b6528b6 resourceloader: Skip version hash calculation in debug mode
=== Why

* More speed

  In debug mode, the server should regenerate the startup manifest
  on each page view to ensure immediate effect of changes. But,
  this also means more version recomputation work on the server.

  For most modules, this was already quite fast on repeat views
  because of OS-level file caches, and our file-hash caches and
  LESS compile caches in php-apcu from ResourceLoader.
  But, this makes it even faster.

* Better integration with browser devtools.

  Breakpoints stay more consistently across browsers when the
  URL stays the same even after you have changed the file and
  reloaded the page. For static files, I believe most browsers ignore
  query parameters. But for package files that come from load.php,
  this was harder for browsers to guess correctly which old script URL
  is logically replaced by a different one on the next page view.

=== How

Change Module::getVersionHash to return empty strings in debug mode.

I considered approaching this from StartupModule::getModuleRegistrations
instead to make the change apply only to the client-side manifest.

I decided against this because we have other calls to getVersionHash
on the server-side (such as for E-Tag calculation, and formatting
cross-wiki URLs) which would then not match the version queries that
mw.loader formats in debug mode.

Also, those calls would still be incurring some the avoidable costs.

=== Notes

* The two test cases for verifying the graceful fallback in production
  if version hash computations throw an exception, were moved to a
  non-debug test case as no longer happen now during the debug
  (unminified) test cases.

* Avoid "PHP Notice: Undefined offset 0" in testMakeModuleResponseStartupError
  by adding a fallback to empty string so that if the test fails,
  it fails in a more useful way instead of aborting with this error
  before the assertion happens. (Since PHPUnit generally stops on the
  first error.)

* In practice, there are still "version" query parameters and E-Tag
  headers in debug mode. These are not module versions, but URL
  "combined versions" crafted by getCombinedVersion() in JS and PHP.
  These return the constant "ztntf" in debug mode, which is the hash
  of an empty string. We could alter these methods to special-case
  when all inputs are and join to a still-empty string, or maybe we
  just leave them be. I've done the latter for now.

Bug: T235672
Bug: T85805
Change-Id: I0e63eef4f85b13089a0aa3806a5b6f821d527a92
2021-09-15 18:13:09 -07:00
Timo Tijhof
7c6713b4d9 resourceloader: Make getVersionHash() final
This is in preparation for making all version hashes the empty string
in debug mode, which will make things faster to work with, but also
helps solve T235672 in an easy way client-side without having to
add additional complexity to the mw.loader client that is specific
to debug mode.

Bug: T235672
Change-Id: I43204f22dfbcf5d236b35adc5b35df3da8021bad
2021-09-15 18:10:49 -07:00
jenkins-bot
0f5cea7823 Merge "RELEASE-NOTES-1.37: Note changes in HTMLTitleTextField" 2021-09-15 23:51:16 +00:00
jenkins-bot
987e8b8324 Merge "objectcache: improve the WANObjectCache "lag mitigation" TTL logic" 2021-09-15 22:55:08 +00:00
Alexander Vorwerk
da26927c73 Remove FileBackendGroup::singleton() and ::destroySingletons()
both deprecated since 1.35, hard deprecated since 1.37 and unused.

Bug: T249025
Change-Id: Ie4759fa3fa25202d623317acb444079f10e33817
2021-09-15 19:21:30 +02:00
Alexander Vorwerk
d028567e4c Remove MessageCache::singleton()
deprecated since 1.34, hard deprecated since 1.37 and unused.

Bug: T249031
Change-Id: Iab7e0dda610b2e65624ede2a0bb419b0b9cc03d1
2021-09-15 18:13:37 +02:00
Alexander Vorwerk
0139a3b814 Remove LinkCache::singleton()
Deprecated since 1.28, hard deprecated since 1.37 and unused.

Bug: T249034
Change-Id: I224272e428f49db2498c30e6d12e2280fd580469
2021-09-15 18:05:34 +02:00
jenkins-bot
526a6261e0 Merge "Update credits ahead of the 1.37 release" 2021-09-15 15:34:36 +00:00
jenkins-bot
ca252b6ee9 Merge "Make UserDefTest a unit test" 2021-09-15 14:36:53 +00:00
Martin Urbanec
949b16b9f5 RELEASE-NOTES-1.37: Note changes in HTMLTitleTextField
Bug: T288181
Change-Id: I3bea0e5682b98647a9489b3d39f9a068de017a61
2021-09-15 14:42:50 +02:00
jenkins-bot
403af2eaba Merge "Deprecate Skin::getCopyrightIcon. Skin::getPoweredBy, SkinGetPoweredBy hook" 2021-09-15 06:41:52 +00:00
Translation updater bot
c8a890fc77 Localisation updates from https://translatewiki.net.
Change-Id: I819136a588d1fa32e582f68401de0c4d781593b8
2021-09-15 08:00:28 +02:00
Tim Starling
4f41e2addd Add slow-parsoid log channel
By analogy with slow-parse.log. Also, I fixed the log message so that it
has the full title in it.

Change-Id: Icaeb6f002c5c2a676467d4c760f99cb2676ad73b
2021-09-15 15:48:11 +10:00
jdlrobson
f9be83e310 Deprecate Skin::getCopyrightIcon. Skin::getPoweredBy, SkinGetPoweredBy hook
The skin methods serve BaseTemplate so are moved there. The associated
hook is seldom used so deprecated.

Bug: T290583
Change-Id: I166241fc88b98603f8d5489643eda984f49bad66
2021-09-14 20:53:46 -07:00
jenkins-bot
04820b38cd Merge "Disable hidden radio buttons on page history to fix behavior on Firefox" 2021-09-14 21:49:22 +00:00
jenkins-bot
d018c4f6ed Merge "rdbms: Add more return typehints" 2021-09-14 20:51:25 +00:00
Bartosz Dziewoński
eec9b5b8f0 ChangeTags: Add CSS classes to rows for hidden tags too
This allows these rows to be highlighted on Special:RecentChanges and
similar pages, and allows site CSS to target them as well.

Bug: T281741
Change-Id: Iebe234166d76e19736f626370b0384c49ceb1355
2021-09-14 22:51:09 +02:00
jenkins-bot
511e8ca3d0 Merge "objectcache: Misc micro-optimisations in WANObjectCache" 2021-09-14 20:41:47 +00:00
jenkins-bot
79e081810d Merge "Revert "Introduce AbstractLocalizedException"" 2021-09-14 20:10:48 +00:00
jenkins-bot
a7e6a04334 Merge "Remove Title from signatures in CategoryViewer" 2021-09-14 19:04:18 +00:00
TChin
e67f822bc9 Revert "Introduce AbstractLocalizedException"
This reverts commit 0d453d915a.

Reason for revert: Trying to find a better approach than an abstract class

Change-Id: I69c0ec25cb920f41cb0eb6b3ad921d7b02290581
2021-09-14 19:01:21 +00:00