r99803 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99802‎ | r99803 | r99804 >
Date:20:50, 14 October 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:fundraising 
Comment:
Put in a check to make sure the key (STATUSID) in the $response array exists to prevent PHP notices on the site.
Modified paths:
  • /branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: branches/fundraising/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -293,7 +293,8 @@
294294
295295 function processResponse( $response ) {
296296 //set the transaction result message
297 - $this->setTransactionResult( "Response Status: " . $response['STATUSID'], 'txn_message' ); //TODO: Translate for GC.
 297+ $responseStatus = isset( $response['STATUSID'] ) ? $response['STATUSID'] : '';
 298+ $this->setTransactionResult( "Response Status: " . $responseStatus, 'txn_message' ); //TODO: Translate for GC.
298299 $this->setTransactionResult( $this->getData( 'order_id' ), 'gateway_txn_id' );
299300 }
300301

Follow-up revisions

RevisionCommit summaryAuthorDate
r100054Checks to see if the array key exists, so it won't explode badly if the respo...khorn17:22, 17 October 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   17:18, 17 October 2011

This is causing errors if STATUSID isn't a present array key in $response.

#Comment by Khorn (WMF) (talk | contribs)   17:22, 17 October 2011

...but I fixed it.

#Comment by Khorn (WMF) (talk | contribs)   18:07, 17 October 2011

Actually, I'm dumb. This works just fine the way it is. For some reason I was thinking it was two keys deep or something.

Status & tagging log