Cover incomplete revision case in RenderedRevision.
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 3 Sep 2018 13:34:12 +0000 (15:34 +0200)
committerJforrester <jforrester@wikimedia.org>
Tue, 11 Sep 2018 15:25:11 +0000 (15:25 +0000)
commitc391e4870c76a80802a68360625c316d835360f2
tree94e91a9589945103ec9eeaf14b01d19b1a7776b4
parent05b2874f376d568d293aa46f21a3f7b484a984be
Cover incomplete revision case in RenderedRevision.

This introduces a check that allows magic words like {{REVISIONUSER}}
to still work even when an incomplete fake RevisonRecord is provided to
RevisionRenderer. In such a case, the revision is loaded from the database
if needed. This lets old code that only has access to a Content object for
rendering use that Content object in a fake RevisionRecord, instead of
having to load the full revision from the database in all cases.

Bug: T174035
Change-Id: I658eab97a8282b8943baf7968f3256da35789ec1
includes/Revision/RenderedRevision.php
tests/phpunit/includes/Revision/RenderedRevisionTest.php
tests/phpunit/includes/Revision/RevisionRendererTest.php