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
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
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
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
Consistency of language, syntax, wording and styling. Or, at least,
a first stab at this.
Bug: T289590
Change-Id: I15d2c617419141e4c1d440c46806a3150d1b4ee0
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
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
=== 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
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
By analogy with slow-parse.log. Also, I fixed the log message so that it
has the full title in it.
Change-Id: Icaeb6f002c5c2a676467d4c760f99cb2676ad73b
The skin methods serve BaseTemplate so are moved there. The associated
hook is seldom used so deprecated.
Bug: T290583
Change-Id: I166241fc88b98603f8d5489643eda984f49bad66
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
This reverts commit 0d453d915a.
Reason for revert: Trying to find a better approach than an abstract class
Change-Id: I69c0ec25cb920f41cb0eb6b3ad921d7b02290581