Actually return the title of the section, instead of the pagetitle when requesting...
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Wed, 6 Jul 2011 20:41:12 +0000 (20:41 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Wed, 6 Jul 2011 20:41:12 +0000 (20:41 +0000)
Fixes bug 29746

RELEASE-NOTES-1.19
includes/api/ApiQuerySearch.php

index c135eb7..bb993b4 100644 (file)
@@ -166,6 +166,8 @@ production.
 * (bug 26763) Make RSS/Atom of user contributions more visible
 * (bug 25133) Allow redirects also for action=parse&pageid
 * (bug 29745) Fatal error in API search
+* (bug 29476) API returns page title instead of sectiontitle for
+  srprop=sectiontitle
 
 === Languages updated in 1.19 ===
 
index bd7adc2..84f547e 100644 (file)
@@ -162,7 +162,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                }
                                if ( !is_null( $result->getSectionTitle() ) ) {
                                        if ( isset( $prop['sectiontitle'] ) ) {
-                                               $vals['sectiontitle'] = $result->getSectionTitle();
+                                               $vals['sectiontitle'] = $result->getSectionTitle()->getFragment();
                                        }
                                        if ( isset( $prop['sectionsnippet'] ) ) {
                                                $vals['sectionsnippet'] = $result->getSectionSnippet();