Sn1per has uploaded a new change for review.
https://gerrit.wikimedia.org/r/227764
Change subject: Add pageid to API parse output
......................................................................
Add pageid to API parse output
Bug: T27134
Change-Id: I4ef765e18020f93d7861e62d20649c89fca0f828
---
M includes/api/ApiParse.php
M includes/api/i18n/en.json
2 files changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/64/227764/1
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index 577b525..e9de49a 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -261,6 +261,10 @@
$result_array['title'] = $titleObj->getPrefixedText();
+ if ( isset( $prop['pageid'] ) ) {
+ $result_array['pageid'] = $pageid ? $pageid :
$pageObj->getId();
+ }
+
if ( !is_null( $oldid ) ) {
$result_array['revid'] = intval( $oldid );
}
@@ -723,7 +727,7 @@
),
'prop' => array(
ApiBase::PARAM_DFLT =>
'text|langlinks|categories|links|templates|' .
-
'images|externallinks|sections|revid|displaytitle|iwlinks|properties',
+
'images|externallinks|sections|revid|pageid|displaytitle|iwlinks|properties',
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => array(
'text',
@@ -736,6 +740,7 @@
'externallinks',
'sections',
'revid',
+ 'pageid',
'displaytitle',
'headitems',
'headhtml',
diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json
index ae7a9c6..941e244 100644
--- a/includes/api/i18n/en.json
+++ b/includes/api/i18n/en.json
@@ -292,6 +292,7 @@
"apihelp-parse-paramvalue-prop-externallinks": "Gives the external
links in the parsed wikitext.",
"apihelp-parse-paramvalue-prop-sections": "Gives the sections in the
parsed wikitext.",
"apihelp-parse-paramvalue-prop-revid": "Adds the revision ID of the
parsed page.",
+ "apihelp-parse-paramvalue-prop-pageid": "Adds the page ID of the parsed
page.",
"apihelp-parse-paramvalue-prop-displaytitle": "Adds the title of the
parsed wikitext.",
"apihelp-parse-paramvalue-prop-headitems": "Gives items to put in the
<code><head></code> of the page.",
"apihelp-parse-paramvalue-prop-headhtml": "Gives parsed
<code><head></code> of the page.",
--
To view, visit https://gerrit.wikimedia.org/r/227764
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ef765e18020f93d7861e62d20649c89fca0f828
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sn1per <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits