If rev_content_model is null, use page_content_model.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 7 Jul 2016 13:06:12 +0000 (15:06 +0200)
committerJdlrobson <jrobson@wikimedia.org>
Fri, 8 Jul 2016 21:47:12 +0000 (21:47 +0000)
commit9a6ff0bd82faafbf9746a6fa3ed33f42092587c3
tree1a2ddb7394989f6213751e89a2a83ed9e36d1d09
parentd1f59ae9deec27d93fecf2dd562650b054d4b88e
If rev_content_model is null, use page_content_model.

We currently leave rev_content_model = null  if it'S the default, to save space.
When loading a revision, we so far fell back to the per-namespace default content
model if rev_content_model was null, even if page_content_model was null.

This patch changes the fallback from rev_contentModel -> namespace-default-model
to rev_content_model -> page_content_model -> namespace-default-model.

This will prevent errors triggered when chaing a namespace'sdefault content model:
so far, revisions with the old content model would fail to deserialize becaue,
because they were being interpreted according to the changed namespace defrault,
instead of the correct model in page_content_model.

Bug: T128466
Change-Id: I75c60eb129428b0b433480443ab9153cc58cda8f
includes/Revision.php
tests/phpunit/includes/RevisionStorageTest.php