From: Brad Jorsch Date: Thu, 23 Apr 2015 14:21:11 +0000 (-0400) Subject: ApiEditPage: Fetch content model from article, not title X-Git-Tag: 1.31.0-rc.0~11590^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=480e8cceb1bcf9fd6fa6e639d641a51717068a11;p=lhc%2Fweb%2Fwiklou.git ApiEditPage: Fetch content model from article, not title The Title object's cached content model isn't updated after the edit. The Article object fetches the model from the revision that was just created, so let's just use that instead. Bug: T96937 Change-Id: I4c5ab3ec6829d403a29a8a8f55e7458730369034 --- diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 0dee147d06..6ab8483afa 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -497,7 +497,7 @@ class ApiEditPage extends ApiBase { $r['result'] = 'Success'; $r['pageid'] = intval( $titleObj->getArticleID() ); $r['title'] = $titleObj->getPrefixedText(); - $r['contentmodel'] = $titleObj->getContentModel(); + $r['contentmodel'] = $articleObject->getContentModel(); $newRevId = $articleObject->getLatest(); if ( $newRevId == $oldRevId ) { $r['nochange'] = true;