When a nonexistent message is requested, a WAN cache request results,
because nonexistent keys are suppressed in the main cache by
isMainCacheable(). There is some performance degradation when such
keys are requested on every page view.
So:
* Make it so that keys prefixed with accesskey-, tooltip- and nstab-
use Message::isDisabled() instead of Message::exists(), so that they
can be blank instead of missing by default.
* Add blank messages for several such keys.
Change-Id: Ie70d849a8ecbf9ab70e58f582b9ba89afe9f2829
Upstream Minerva and MobileFrontend override.
Most message boxes don't include a heading
but when they do, inline doesn't work.
This allows us to remove rules in Minerva and MobileFrontend.
Bug: T300306
Change-Id: Ia57d98d4be39028aa2dfe4ed737755fca79c0db3
The "error" class nowadays is only supposed to be used by Parser and
related code. It renders as red text with no special formatting.
Instead use Html::warningBox(), which renders a yellow box around the
text. (Not Html::errorBox(), because these are not really errors.)
Change-Id: I7a7046bf9b9765cbb82ec3caa1530de7f05e0da4
This just helps distinguish ParserOutput and OutputPage in code search,
since they have many identically-named methods.
(See Ie4d6bbe258cc483d5693f7a27dbccb60d8f37e2c for instance.)
Change-Id: I786381c98c6d7e1f5e9d7333d6f53a282985fbbc
If a RefreshLinksJob is created with an improper/invalid title,
executing the job later will fail with a PageAssertionException
while trying to create a WikiPage for that title. Better check
the title when constructing the job, so the offending code is on the
stack when it happens.
Bug: T293291
Depends-On: I7dcfac0eacdd5b22bdf443e88f8e6ddb883b92cc
Change-Id: I77a622591836873415f097453da01ca7e61c41be
Title::newFromText with empty string will always yields null.
But the decision to return null is only made after applying
various normalization and filtering routines, which will
eventually have zero effect on the return value. So we may
just return the null early as we do with null itself.
Change-Id: Ic277a6e8c8c0b2a0b6af78f6524b80574c4602af
Valid values for ParserCache::$mIndexPolicy are '', 'noindex', and 'index'.
The test cases use the bogus value 'policy1', which causes issues when
refactoring more strictly enforces validity checks on index policy
values.
Change-Id: I2d00ff4e3ded043d18942c8482a39fac14ec60bc
Just added the low-hanging fruit: the methods where the return type was
obvious from local inspection.
Change-Id: If6aabfc8f0dacb156167745808fd5c57cdb3eb23
This is a first draft of the configuration doc renderer.
The resulting markdown certainly needs some love, but
we can work on improvements incrementally. This gives
us a baseline to reference on doc.wikimedia.org
Bug: T296647
Change-Id: I3c426b9fc37b1cf7ce8423969b2d7589767ee6cc
LightnCandy resolves recursively-defined partials twice, which leads to
the template file being hashed twice. While the cost of hashing the
partial the second time is minimised due to
FileContentsHasher::getFileContentsHash() caching the hash of a file in
APCu, it need not be paid.
Bug: T300210
Change-Id: Id3f62bf32c47f21181b1ec6d77a5ae9a703952b1
Forced-on options (selected as default but disabled) should always in
the loaded data, like what HTMLCheckMatrix do.
Change-Id: I342928eca01ae8a9f34ee7156a515524c3a0d9dd
Skin::buildSidebar() accounts for 3.6% of index.php CPU time in
production, and local testing shows it being called 3 times for a
useskin=minerva page view. But it is stable for override, so we can't
implement caching transparently to the caller since subclasses would not
do caching.
There is SkinMinerva::buildSidebarCached() -- without that,
buildSidebar() would have been called 4 times instead of 3.
So, add a process cache for it.
Change-Id: Iffe63c465f6039336ebbdccd88f2a55fba8883d0
This silences the "Unable to determine file type from the file
extension, defaulting to js" warning shown when running `grunt qunit`.
Bug: T250045
Change-Id: Ife62c53d1e2ff6121774552c7d0793784aea6d6b
Usage:
* DiscussionTools tests: `grunt qunit --qunit-component=DiscussionTools`
* MediaWiki core tests only: `grunt qunit --qunit-component=MediaWiki`
It might be nice to have this more granular, to run tests for a single
file, or a single ResourceLoaderModule, but will leave that to another
time; it is already fast.
Note that some projects may fail, e.g. GrowthExperiments has a test
failure due to not mocking all of the dependencies needed for the
test code; that can be worked around by adjusting the application code
or the test registration to include all needed dependencies.
Example fixes:
* GrowthExperiments: Iea3a89a902cd17dd91696d2a37144baa9e452077
* MinervaNeue: I8f747e3df196055361d53d00fea833fb9de892f0
The only other extension I see that has one broken test when run
this way is VisualEditor.
Bug: T250045
Change-Id: I977150ece26f5878a0ccc42d39bed6c7e74e9602