Added:
- ContentHandlerFactory
Tests:
- PHPUnit
Changed
- Calls of changed and deprecated
- DI for some service/api
Deprecated:
- ContentHandler::* then similar to ContentHandlerFactory
- ContentHandler::getForTitle
- ContentHandler::$handlers
Bug: T235165
Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
A new inline mode is provided for diffs.
It is only available when wikidiff2 is installed.
There is no PHP implementation (one can be added later if
necessary)
For now, it is accessed by passing diff-type as a query string parameter
e.g ?diff-type=inline
A control for switching between the two is added as a follow up.
see Ie9bb17789d90b7492559782021937f3f3e4356f8
* The final method getSlotDiffRenderer now takes a second parameter
options
* The method `getSlotDiffRendererInternal` is deprecated and
replaced with the more flexible `getSlotDiffRendererWithOptions`
This has potential to be a breaking change but is unlikely to impact
any existing clients.
Note: PHP implementation can be added later if necessary
Bug: T117279
Change-Id: I4f81c8ccf253dd4aa6cf43c3fad257b4b0dd1ebd
In several places, we're including rc_timestamp or other fields in a
query selecting on rc_this_oldid because there was historically no index
on the column.
The needed index was created by I0ccfd26d and deployed by T202167, so
let's remove the hacks.
Bug: T139012
Bug: T239772
Change-Id: Ic99760075bde6603c9f2ab3ee262f5a2878205c7
Recent changes have caused the method for counting the number of
revisions in between the two sides of a diff to throw an error when the
revisions have different page IDs.
This blows up some cases of trying to get a difference between deleted
revisions, as the page IDs on the deleted revisions might not match
and/or might not match the current ID returned by the Title object.
Bug: T237709
Change-Id: I415f7ebb57fa4e879396b0db0e3a79edc2880be5
The immediate use case is for testing, where some tests need to use the
PHP implementation even when wikidiff2 is installed.
Bug: T237049
Change-Id: I41dc4c0933429065d7638f518ec31f0a056afc41
* Add 'from' and 'to' query parameters to history count endpoint,
in case we are counting 'edits'. The support for parameters will be
expanded in the future, given that 'editors' is on the way.
* Refactor RevisionStore::countRevisionsBetween to be able to omit
starting or ending revision.
Bug: T235666
Change-Id: I1fc3f2d4e422f17ccfc99664ea35e210c13ade5f
Ib404d29a662de7736b50a1d07380f651d332ad6b introduced a new sanity
check in RevisionStore::countRevisionsBetween to check whether
the ids are not null (otherwise, they're considered unsaved)
For MCR undo actions, diffs could be generated for unsaved revisions
(where one revision is a not yet pre-existing combination where
some slots remain unchanged, but some slot gets undone)
The existing if statement here was already trying to guard against
unsaved revisions, but was doing so in a way different from the
new checks in RevisionStore::countRevisionsBetween - even though this
was documented to only diff saved revisions, it wasn't checking
thoroughly enough, and an exception would crop up later.
Bug: T236320
Change-Id: If34766675f50b67d8b0788a6eab07d8d4e6fe183
In preparation for adding the MobileFrontend DifferenceEngine
some light refactoring of the uber-function showDiffPage is
required.
This begins by extracting several helper functions that will
be used inside the new InlineDifferenceEngine class (and addressing
the FIXME's inside MobileFrontend's code.
Hopefully the new code is much more readable by explaining the
complicated logic that lives inside the showDiff function
Bug: T117279
Change-Id: Iede69d1b87ac100472087584968df2d479e13f60
Some of the errors are suppressed because they're phan false positives.
The idea behind this is that they'll be fixed in a future version of
phan, and we'll just have to remove the suppressions.
Note: I'm disabling UnusedPluginSuppression so that we can start suppressing
issues even if they're still disabled. The sniff should be re-enabled
as soon as we upgrade phan.
Bug: T231636
Change-Id: I0f7fa06a9e03fbb86c7a5eb6e50a850bb258a7f7
These were all checked with codesearch to ensure nothing is overriding
these methods.
For the most part, I've updated the signature to use nullable types; for
two Pager's, I've just made all parameters non-optional, because you're
already forced to pass them with a required parameter at the end.
Bug: T231636
Change-Id: Ie047891f55fcd322039194cfa9a8549e4f1f6f14
Title::userCan is too expensive for this, as it queries the master DB
just to decide whether a link should be shown.
The DBPerformance warning for this is seen roughly 8000 times per day on
logstash.
Bug: T232258
Change-Id: I33eab493273ed4790645e338c83993043e76e1d7
In Ia94521b78 I introduced code that would suppress undo links in diffs
of non-textual content. However, extensions that define non-textual
content, such as Wikibase, may override action handles to provide undo
functionality. So my reasoning for removing these links was flawed.
Bug: T232214
Change-Id: I0316d8c0683b0782b9940e0e1e8f70d5bcb6b468
UnknownContentHandler can be configued to handle models that
belong to extensions that have been undeployed:
$wgContentHandlers['xyzzy'] = 'UnknownContentHandler';
This way, no errors will be thrown when trying to access
pages with the unsupported model. Instead, an error message is
shown, and editing is prevented.
This patch also improves handling of non-editable content in
EditPage and in DifferenceEngine.
Bug: T220608
Change-Id: Ia94521b786c0a5225a674e4dc3cb6761a723d75b
T208768 introduced the PermissionManager service that can now be used
for page specific permission checks. This change replaces remaining calls
to Title::userCan() with the new service in MediaWiki core.
Bug: T220191
Change-Id: Ie45e0cb6aa49a8c66147b470946161fc18160fc1
Also, as I'm touching this line, fixing the is_null() check to
finally clean this entire line up once and for all.
Change-Id: I573972519796f3eedaf950fa953b9df6b6824379
The styles that we are applying on changelist pages should also
apply on diff pages. This generalises the rules into a new
module.
To avoid problems with cached HTML mediawiki.special.changeslist
temporarily loads resources/src/mediawiki.interface.helpers.styles.
This will be removed after the change has been in production for a
week.
Bug: T212613
Change-Id: I6aad563e48f41c783df8b176a4f437e60a1255cc