r89893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89892‎ | r89893 | r89894 >
Date:21:01, 11 June 2011
Author:gurch
Status:ok (Comments)
Tags:
Comment:
ArticleFeedback API:

* don't throw internal error when there are no ratings for a page
* tidy documentation
Modified paths:
  • /trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php
@@ -111,7 +111,10 @@
112112 }
113113
114114 foreach ( $ratings as $rat ) {
115 - $result->setIndexedTagName( $rat['ratings'], 'r' );
 115+ if ( isset( $rat['ratings'] ) ) {
 116+ $result->setIndexedTagName( $rat['ratings'], 'r' );
 117+ }
 118+
116119 $result->addValue( array( 'query', $this->getModuleName() ), null, $rat );
117120 }
118121
@@ -263,15 +266,15 @@
264267
265268 public function getParamDescription() {
266269 return array(
267 - 'pageid' => 'Page ID to get feedbacks for',
268 - 'userrating' => "Whether to get the current user's ratings for the specific rev/article",
 270+ 'pageid' => 'Page ID to get feedback ratings for',
 271+ 'userrating' => "Whether to get the current user's ratings for the specified page",
269272 'anontoken' => 'Token for anonymous users',
270273 );
271274 }
272275
273276 public function getDescription() {
274277 return array(
275 - 'List all article feedbacks'
 278+ 'List article feedback ratings for a specified page'
276279 );
277280 }
278281
@@ -285,7 +288,6 @@
286289
287290 protected function getExamples() {
288291 return array(
289 - 'api.php?action=query&list=articlefeedback',
290292 'api.php?action=query&list=articlefeedback&afpageid=1',
291293 'api.php?action=query&list=articlefeedback&afpageid=1&afuserrating=1',
292294 );

Comments

#Comment by Catrope (talk | contribs)   03:40, 12 June 2011

Fixes bug 29278.

Thanks!

#Comment by Catrope (talk | contribs)   03:41, 12 June 2011

Ah, I meant bug 29275.

#Comment by Gurch (talk | contribs)   04:29, 12 June 2011

oops, yeah I should probably close my own bugs when I fix them :)

Thanks for clearing that up

Status & tagging log