From: Derk-Jan Hartman Date: Wed, 6 Jul 2011 20:41:12 +0000 (+0000) Subject: Actually return the title of the section, instead of the pagetitle when requesting... X-Git-Tag: 1.31.0-rc.0~29026 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=175a4a4032bfc79bb5b3648053a8ff6d74d7d4d4;p=lhc%2Fweb%2Fwiklou.git Actually return the title of the section, instead of the pagetitle when requesting srprop=sectiontitle from API search. Fixes bug 29746 --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index c135eb70bd..bb993b4c99 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 === diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index bd7adc2e96..84f547e24f 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -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();