jenkins-bot has submitted this change and it was merged.
Change subject: Add content model to prop=info
......................................................................
Add content model to prop=info
Fields of page table are shown by default in prop=info
Change-Id: Id8b90c341dea19337558ed355975ab890f0663e2
---
M RELEASE-NOTES-1.22
M includes/api/ApiQueryInfo.php
2 files changed, 10 insertions(+), 2 deletions(-)
Approvals:
Anomie: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index d13c825..fdff848 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -108,6 +108,7 @@
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 6dbda5f..787057d 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -56,7 +56,7 @@
* @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 @@
$pageSet->requestField( 'page_touched' );
$pageSet->requestField( 'page_latest' );
$pageSet->requestField( 'page_len' );
+ if ( $wgContentHandlerUseDB ) {
+ $pageSet->requestField( 'page_content_model' );
+ }
}
/**
@@ -348,6 +351,9 @@
$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 @@
'starttimestamp' => array(
ApiBase::PROP_TYPE => 'timestamp',
ApiBase::PROP_NULLABLE => true
- )
+ ),
+ 'contentmodel' => 'string',
),
'watched' => array(
'watched' => 'boolean'
--
To view, visit https://gerrit.wikimedia.org/r/62177
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id8b90c341dea19337558ed355975ab890f0663e2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits