Spage has uploaded a new change for review.
https://gerrit.wikimedia.org/r/148575
Change subject: Provide namespace to ApiParse->getSectionContent
......................................................................
Provide namespace to ApiParse->getSectionContent
Improves the "Sections are not supported by <PAGE>" error message when
it fails. Also add phpdoc comment
Bug: 68416
Change-Id: Iaa5d3a1f33b8a9c48263c2ce27cd3b4fe98fbf01
---
M includes/api/ApiParse.php
1 file changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/75/148575/1
diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php
index b906b59..2e993e3 100644
--- a/includes/api/ApiParse.php
+++ b/includes/api/ApiParse.php
@@ -213,7 +213,7 @@
}
if ( $this->section !== false ) {
- $this->content = $this->getSectionContent(
$this->content, $titleObj->getText() );
+ $this->content = $this->getSectionContent(
$this->content, $titleObj->getPrefixedText() );
}
if ( $params['pst'] || $params['onlypst'] ) {
@@ -450,7 +450,7 @@
if ( $this->section !== false && $this->content !== null ) {
$this->content = $this->getSectionContent(
$this->content,
- !is_null( $pageId ) ? 'page id ' . $pageId :
$page->getTitle()->getText()
+ !is_null( $pageId ) ? 'page id ' . $pageId :
$page->getTitle()->getPrefixedText()
);
// Not cached (save or load)
@@ -470,6 +470,10 @@
return $pout;
}
+ /**
+ * @param Content $content
+ * @param string $what Identifies the content in error messages, e.g.
page title.
+ */
private function getSectionContent( Content $content, $what ) {
// Not cached (save or load)
$section = $content->getSection( $this->section );
--
To view, visit https://gerrit.wikimedia.org/r/148575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa5d3a1f33b8a9c48263c2ce27cd3b4fe98fbf01
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Spage <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits