This is an attempt at getting a more useful error message than
"Import failed Expected <mediawiki> tag, got"
(ie. XMLReader thinking that the root tag name is the empty string).
E.g. with the dump file I'm debugging at the moment, after applying
this patch I get "XML error at line 1: Extra content at the end of
the document" instead.
Change-Id: I365eebf78c30b644808eb5ac42d0946c8cf60778
WikiPage::doEditUpdates() has been deprecated. Using the PageUpdaterFactory's
newDerivedPageDataUpdater() is the new way forward. Also, I made sure to have
the `$options` array with the `causeAction` and `causeAgent` key/value pairs.
Change-Id: I9f2c212d7c83a46799f9f947dc372dc364289680
It's documented as string only, but some code (possibly test code) is
passing null, causing failures for I0e7e4a48b56c3e5fde56f50693fd0cdc19c30dd0.
Change-Id: I07e2fc0c6249e8bcda3af99213fcf26f17e6df94
Queries that query a value "1" are expected to return either
that "1" (possibly as a string), or false. It's safe to simply
cast this to bool and use it as it is.
Queries for COUNT(*) are expected to return that number,
possibly as a string. It's not possible for such a query to
return false. And even if, casting to 0 is fine.
I found an existing code style where the table name and the
"1" are on the same line as the selectField() method name, and
applied it to all similar queries.
Change-Id: I9453196281871c03ef03f653f43762eb9284342f
The fallback to global state for the services injected into
WikiImporter has been removed with Ide7693a411d, thus these
services need to be injected and are not allowed to be null.
Bug: T283530
Change-Id: Iff6e673f56c48bafad4f7dc5732e136b9359f149
Need to rely on RequestContext::getMain() since no user is
available nor is injecting one simple to do (the calling method,
::finishImportPage, is used as a callback and extensions can
replace it with their own callbacks instead)
Bug: T285447
Change-Id: I02e01e52909da51e7001b4acee43567ae645d9a7
This patch injects services into WikiImporter. It also adds
a WikiImporterFactory service for creating WikiImporter
instances.
Change-Id: I2966297e5728fca1ae8280361f1008cef6c6041b
Rather than retrieving from MediaWikiServices in
the factory class, retrieve it in WikiImporter and inject
it, so that the factory uses proper DI and the
tests can eventually become unit tests
Change-Id: I6fe63829f0e65b261b6ae12e17f354333cde70b9
Soft deprecated since 1.31 and no longer in use save one usage
in WikiImporter which has been replaced too.
Change-Id: I88305fb7579d66fd402646f1717f2d528bf90d02
Since we only want close the reader and entity loader, there's
no need for catch and rethrow as finally can handle this as we want.
Change-Id: I52c1e597e1588941d50211d1c71fc19cc414d8e4
When making primitive tests for HookRunner in
I8d0a34e185aad79a391acdd47e506c8911c75257 I've
notived that coverage was not 100% and found that
this hook interface was forgotten.
Change-Id: Ic877fd1f2bbac5a1af708f283e9e0b7a49f89d88
We were using the master to load revision data from the revision
table, but not when loading slot data. We should use the master DB for
both, consistently.
Bug: T258666
Change-Id: I800adb852ec690b63fa926f40428de3272d69584
The last constructor parameter is now mandatory.
Depends-on: Ifd5dbc2b947533a5e926c581e1c5a67e4af147dc
Bug: T220525
Change-Id: I47071440a9696f18568e542fe6eee32843c28210
For compliance with the new version of the table interface policy
(T255803).
This patch was created by an automated search & replace operation
on the includes/ directory.
Bug: T257789
Change-Id: I17e5e92e24c708ffc846945a136347670a3a20c7