http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89893
Revision: 89893 Author: gurch Date: 2011-06-11 21:01:08 +0000 (Sat, 11 Jun 2011) Log Message: ----------- 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: trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php =================================================================== --- trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php 2011-06-11 20:27:50 UTC (rev 89892) +++ trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php 2011-06-11 21:01:08 UTC (rev 89893) @@ -111,7 +111,10 @@ } foreach ( $ratings as $rat ) { - $result->setIndexedTagName( $rat['ratings'], 'r' ); + if ( isset( $rat['ratings'] ) ) { + $result->setIndexedTagName( $rat['ratings'], 'r' ); + } + $result->addValue( array( 'query', $this->getModuleName() ), null, $rat ); } @@ -263,15 +266,15 @@ public function getParamDescription() { return array( - 'pageid' => 'Page ID to get feedbacks for', - 'userrating' => "Whether to get the current user's ratings for the specific rev/article", + 'pageid' => 'Page ID to get feedback ratings for', + 'userrating' => "Whether to get the current user's ratings for the specified page", 'anontoken' => 'Token for anonymous users', ); } public function getDescription() { return array( - 'List all article feedbacks' + 'List article feedback ratings for a specified page' ); } @@ -285,7 +288,6 @@ protected function getExamples() { return array( - 'api.php?action=query&list=articlefeedback', 'api.php?action=query&list=articlefeedback&afpageid=1', 'api.php?action=query&list=articlefeedback&afpageid=1&afuserrating=1', ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs