From: umherirrender Date: Wed, 8 May 2013 18:08:40 +0000 (+0200) Subject: Add content model to prop=info X-Git-Tag: 1.31.0-rc.0~19735 X-Git-Url: http://git.cyclocoop.org//%27http:/ie7-js.googlecode.com/svn/test/index.html/%27?a=commitdiff_plain;h=69c42aadaa7de3cd6c5836e2ff0dce148890b74d;p=lhc%2Fweb%2Fwiklou.git Add content model to prop=info Fields of page table are shown by default in prop=info Change-Id: Id8b90c341dea19337558ed355975ab890f0663e2 --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index d13c825189..fdff848844 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -108,6 +108,7 @@ production. stored in the database. * (bug 47219) Allow specifying change type of Wikipedia feed items * prop=imageinfo now allows setting iiurlheight without setting iiurlwidth +* prop=info now adds the content model of the title. === Languages updated in 1.22=== diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 6dbda5fb09..787057d128 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -56,7 +56,7 @@ class ApiQueryInfo extends ApiQueryBase { * @return void */ public function requestExtraData( $pageSet ) { - global $wgDisableCounters; + global $wgDisableCounters, $wgContentHandlerUseDB; $pageSet->requestField( 'page_restrictions' ); // when resolving redirects, no page will have this field @@ -70,6 +70,9 @@ class ApiQueryInfo extends ApiQueryBase { $pageSet->requestField( 'page_touched' ); $pageSet->requestField( 'page_latest' ); $pageSet->requestField( 'page_len' ); + if ( $wgContentHandlerUseDB ) { + $pageSet->requestField( 'page_content_model' ); + } } /** @@ -348,6 +351,9 @@ class ApiQueryInfo extends ApiQueryBase { $titleExists = $pageid > 0; //$title->exists() needs pageid, which is not set for all title objects $ns = $title->getNamespace(); $dbkey = $title->getDBkey(); + + $pageInfo['contentmodel'] = $title->getContentModel(); + if ( $titleExists ) { global $wgDisableCounters; @@ -819,7 +825,8 @@ class ApiQueryInfo extends ApiQueryBase { 'starttimestamp' => array( ApiBase::PROP_TYPE => 'timestamp', ApiBase::PROP_NULLABLE => true - ) + ), + 'contentmodel' => 'string', ), 'watched' => array( 'watched' => 'boolean'