User "Awjrichards" changed the status of MediaWiki.r101502.

Old Status: new
New Status: reverted

User "Awjrichards" also posted a comment on MediaWiki.r101502.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/101502#c25315
Commit summary:

Actually fixes the api calls that handle gateway forms with _cache_ set to 
true, and a utm_source_id set.
r101441

Comment:

<pre>
+       function canCache(){
+               if ( $this->getVal( '_cache_' ) === 'true' ){ //::head. hit. 
keyboard.::
+                       if ( $this->isSomething( 'utm_source_id' ) && 
$this->getVal( 'utm_source_id' ) !== false ){
+                               return true;
+                       }
+               }
+               return false;
+       }
</pre>
Because you have utm_source_id defaulting to '0' (from line ~99 of 
DonationData.php):
<pre>
'utm_source_id' => $wgRequest->getVal( 'utm_source_id', 0 )
</pre> 
This will /always/ return true when _cache_=true is set. You might consider 
defaulting utm_source_id to NULL and checking if ( !is_null( $this->getVal( 
'utm_source_id' ))).

I know this is the lamest way ever to handle caching. Hopefully we can get 
around to making this suck less.

Also, 
<pre>
+               //TODO: Seriously, you need to move this. 
+               if ( $this->isSomething('payment_method') ){
+                       $payment_method = $this->getVal( 'payment_method' );
+               } else {
+                       $payment_method = 'cc';
+               }
</pre>
I'm not sure you need to do this since you're defaulting payment_method to 'cc' 
in DonationData (~line 61).

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to