Add UnknownContentHandler.
authordaniel <dkinzler@wikimedia.org>
Wed, 21 Aug 2019 15:51:10 +0000 (17:51 +0200)
committerMobrovac <mobrovac@wikimedia.org>
Thu, 29 Aug 2019 10:43:11 +0000 (10:43 +0000)
commit6906a7728cf5447d30da6c7a51add936f469978a
treef931a62b04d7ca8bd61f410ff863414a24ec7442
parenteb4ac89d6690ed4504206de5678a9a50e5edaadf
Add UnknownContentHandler.

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
14 files changed:
autoload.php
includes/EditPage.php
includes/content/UnknownContent.php [new file with mode: 0644]
includes/content/UnknownContentHandler.php [new file with mode: 0644]
includes/diff/DifferenceEngine.php
includes/diff/SlotDiffRenderer.php
includes/diff/TextSlotDiffRenderer.php
includes/diff/UnsupportedSlotDiffRenderer.php [new file with mode: 0644]
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/MediaWikiUnitTestCase.php
tests/phpunit/includes/content/UnknownContentHandlerTest.php [new file with mode: 0644]
tests/phpunit/includes/content/UnknownContentTest.php [new file with mode: 0644]
tests/phpunit/includes/diff/UnsupportedSlotDiffRendererTest.php [new file with mode: 0644]