jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: Iaa5d3a1f33b8a9c48263c2ce27cd3b4fe98fbf01
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Spage <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to