r99034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99033‎ | r99034 | r99035 >
Date:19:40, 5 October 2011
Author:hashar
Status:reverted
Tags:
Comment:
API: give error when trying not attach a comment to a line

Follow up r99030 , we do not have disabled parameters but instead
throw an error when someone attempt to use it.
Modified paths:
  • /trunk/extensions/CodeReview/api/ApiRevisionUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/api/ApiRevisionUpdate.php
@@ -38,8 +38,11 @@
3939 }
4040
4141 global $wgCodeReviewInlineComments;
42 - if( !$wgCodeReviewInlineComments ) {
43 - $params['patchline'] = null;
 42+ if(
 43+ !$wgCodeReviewInlineComments
 44+ && isset( $params['patchline'] )
 45+ ) {
 46+ $this->dieUsage( "Can not attach a comment to a diff when inline commenting is disabled (\$wgCodeReviewInlineComments is false)." );
4447 }
4548
4649 $repo = CodeRepository::newFromName( $params['repo'] );
@@ -94,7 +97,7 @@
9598
9699 public function getAllowedParams() {
97100 $flags = CodeRevision::getPossibleFlags();
98 - $params = array(
 101+ return array(
99102 'repo' => array(
100103 ApiBase::PARAM_TYPE => 'string',
101104 ApiBase::PARAM_REQUIRED => true,
@@ -134,15 +137,11 @@
135138 ApiBase::PARAM_TYPE => 'integer',
136139 ApiBase::PARAM_ISMULTI => true,
137140 ),
138 - );
139 - global $wgCodeReviewInlineComments;
140 - if( $wgCodeReviewInlineComments ) {
141 - $params['patchline'] = array(
 141+ 'patchline' => array(
142142 ApiBase::PARAM_TYPE => 'integer',
143143 ApiBase::PARAM_MIN => 1,
144 - );
145 - }
146 - return $params;
 144+ ),
 145+ );
147146 }
148147
149148 public function getParamDescription() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r108350Reverting inline commenting from CodeReview...johnduhart06:55, 8 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99030disable inline commenting by default...hashar19:14, 5 October 2011

Status & tagging log