A revision-deleted user name is shown for oldid=123&unhide=1
but a revision-deleted comment is not shown.
Just pass the same condition for argument "isPublic" to
Linker::revComment as done for Linker::revUserTools
Bug: T311468
Change-Id: Iad0cf5dd01149764d8a82ab50bc3661acd4c2679
We should slowly migrate page/ to have proper namespace too but that'll
be pretty big.
Bug: T321882
Change-Id: I3e57be8aa8ac08971f190233196e84ea33023d4a
When UseInstantCommons is true the tests with file redirects failing due
to http request to commons.
Needs to reset ForeignFileRepos, because UseInstantCommons is a dynamic
config and already evaluated when tests running
Change-Id: I1a2059e578229210a1e3789bf76fa3dfaa7b6ed3
PageUpdateStatus provides clean access the the newly created
RevisionRecord.
Depends-On: Ia08c586198082ea47e8313d0d41835f9830fb29e
Change-Id: Id6963842321c4eaa3d7d029ad0b769f73433c103
No need to check if the namespace is the same. There are many articles
moved from draft or user space.
Bug: T162871
Change-Id: Ide73adf356df2047ee821d2a3680c9c163e564a9
This just makes the class overly complex and defies the whole point of
having this class in the first place (=delaying getting db connections).
It makes it harder to read and understand and specially polymorphic
arguments are quite confusing.
It also would break the reloading db on the fly (I6c3ffde62f6e), users
of DBConnectionRef should not know about the underlying connection, this
class is trying encpsulate that and accepting connection in constructor
breaks this encapsulation.
Bug: T298485
Depends-On: I951ab99ae766788dbae8bd338aaae114a388b21f
Change-Id: I743c0565504c65c4dedf29f2a36d4c386601fda0
createMock() is still relatively new. This code was using more
complicated mock builders before. This was changed just recently.
createMock() is now so short, the extra helper methods don't make
the code more readable, I would argue.
Change-Id: Ia7e24827157d5f49fc7da102418c79ae33c8e053
In the JavaScript and CSS content handlers we render the page "as
wikitext" solely to generate categories, toc, etc, and then throw that
output away and replace the generated HTML. Simplify the code paths
and the caching by using the canonical options which don't split by
user language, etc.
Three minor issues with the current patch, which can hopefully be
addressed in follow ups:
1. WikiPage::makeParserOptionsFromTitleAndModel() has a very cumbersome
name and arguably doesn't belong in WikiPage in the first place.
T313455 already exists to find a better place for this/way to do this.
2. Title::isConversionTable() requires a downcast of the page reference
to a full title object. This method also probably wants to live
somewhere else.
3. It really would be nice to combine this more properly with
ContentHandler::getParserOutputForIndexing(), but that method
uses a ParserOutputAccess object which requires a PageRecord,
and we don't have a PageRecord available in fillParserOutput().
Bug: T307691
Change-Id: I081105741b507ed49e19cb878550ba4293e09413
This is a quick find & replace of calls to the deprecated method
ParserOptions::newCanonical() when the context is the string literal
'canonical'. This can be safely replaced by called newFromAnon().
Change-Id: If7bb68459b11e0c5f5de188f10fdae85ad1a78bf
Taking into account the pagelanguage should help take into account the
language variant on image pages in languages that have variants.
Bug: T310445
Change-Id: Ic821b2de66ed876e47c74ac21cedaad7a70a80fc
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: I34e492d84d9fc4bc78481667202716d93b3c43cb
This can be done when relevant communities have been notified
and the classes have rolled out of cached HTML.
Bug: T270796
Change-Id: If35ebe88702bf97f2306c77b26d8b3cab4c0420d
Usually we opt to break access control in a test, rather than expose
internals in production classes.
Change-Id: I7e393d2569e8784e2c8eb7ed29d60aab58b9bd83
* Adds option to undelete associated talk page in the context of a
subject page
* If subject page undeletion fails, talk page undeletion is aborted
* If restoring the associated talk page fails, a status with a
warning message is returned
Bug: T304962
Change-Id: I7b30863060974d4079639f57178062d359956c2e
This ensures that assertions work in a uniform way,
and provides meaningful messages in cause of failure.
Change-Id: Ic01715b9a55444d3df6b5d4097e78cb8ac082b3e
There is a common and reasonable need for longer lines in tests.
The nudge for shorter lines doesn't seem valuable here. The natural
breaks will likely still fall in 80-100 given the enforced practice
for non-test code, e.g. whether through habit, or 80-100 column markers
in text editors, or the finite width of diff and code review
interfaces.
Change-Id: I879479e13551789a67624ce66f0946d2f185e6ee
This guards against duplicate parses.
These happen when a page is parsed but an extension needs the
ParserOutput again in the same request when it hasn't made into the
ParserCache yet, or if it is considered uncachable. In that case we
still want to allow re-use within the same process.
Bug: T301310
Change-Id: I1ddd967a40b760b1e53f1fd227cb0d0732f78ec1
Expected value is the first parameter to assertSame() or assertEquals().
And turn to use assertCount() for some assertions aginst count of array.
Based on code search `assert(?:Same|Equals)\(.+,.+expected` and I look
through files roughly, so some assertions that don't contains 'expected'
are also fixed. In the meantime, some assertions that I am not clear
about are not touched.
Change-Id: I75798b60d29fd19b33f4fdf34ed3c788db420d01
getPageCount() method return `cat_pages`, a value that makes sense
on database table but is currently non-intuitve in object context
where there's a value that better deserves the name. This makes it
necessary for callers to repeat same logic to get the content pages
count and a comment to explain the behavior.
In this patch, getMemberCount() is added. It returns the total
member count as getPageCount(), by default, does now.
getPageCount() now takes a parameter and two public constants are
provided for that; Category::COUNT_CONTENT_PAGES return count of all
memebers to retain existing behavior, Category::COUNT_CONTENT_PAGES
will return only content pages.
In future there'd be no need for the parameter. Content pages will
be returned always. Total member count is already accessible with
getMemberCount().
Also improve return type doc of getId() and getName()
Bug: T299350
Change-Id: I63c711ebc697c1a131a50910c854f956d4021254