r108536 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108535‎ | r108536 | r108537 >
Date:19:43, 10 January 2012
Author:bsitu
Status:ok
Tags:
Comment:
followup to -r108454 - define checkbox with default false value and remove isset() check
Modified paths:
  • /trunk/extensions/MoodBar/ApiQueryMoodBarComments.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/ApiQueryMoodBarComments.php
@@ -38,14 +38,14 @@
3939 $this->addOption( 'LIMIT', $params['limit'] + 1 );
4040
4141
42 - if ( isset( $params['myresponse'] ) ) {
 42+ if ( $params['myresponse'] ) {
4343 if ( !$wgUser->isAnon() ) {
4444 $this->addTables( array( 'moodbar_feedback_response' ) );
4545 $this->addWhere( 'mbf_id=mbfr_mbf_id' );
4646 $this->addWhereFld( 'mbfr_user_id', $wgUser->getId() );
4747 $this->addOption( 'GROUP BY', 'mbf_id' );
4848 }
49 - } elseif ( isset( $params['showunanswered'] ) ) {
 49+ } elseif ( $params['showunanswered'] ) {
5050 $this->addTables( array( 'moodbar_feedback_response' ) );
5151 $this->addJoinConds( array( 'moodbar_feedback_response' => array( 'LEFT JOIN', 'mbf_id=mbfr_mbf_id' ) ) );
5252 $this->addWhere( array( 'mbfr_id' => null ) );
@@ -171,8 +171,8 @@
172172 'user' => array(
173173 ApiBase::PARAM_TYPE => 'user',
174174 ),
175 - 'myresponse' => null,
176 - 'showunanswered' => null,
 175+ 'myresponse' => false,
 176+ 'showunanswered' => false,
177177 'prop' => array(
178178 ApiBase::PARAM_TYPE => array( 'metadata', 'formatted', 'hidden' ),
179179 ApiBase::PARAM_DFLT => 'metadata',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108454followup to -r108187 - Checking isset instead of 1/0 for checkbox, adding myr...bsitu18:45, 9 January 2012

Status & tagging log