Index: trunk/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -412,22 +412,29 @@ |
413 | 413 | protected function setFormClass(){ |
414 | 414 | //don't actually try to load the forms here... but do determine if what we've got in there will load or not. |
415 | 415 | //Elsewise, set it to the default. |
| 416 | + $default = false; |
416 | 417 | |
417 | | - if ( $this->isSomething( 'form_name' ) ){ //we're apparently going to try to load a form class. Note: That might not always be true. |
| 418 | + if ( $this->isSomething( 'form_name' ) ){ |
418 | 419 | $class_name = "Gateway_Form_" . $this->getVal( 'form_name' ); |
419 | | - if ( !class_exists( $class_name ) ) { |
420 | | - //try the default |
| 420 | + } else { |
| 421 | + $default = true; |
| 422 | + $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' ); |
| 423 | + } |
| 424 | + |
| 425 | + if ( !class_exists( $class_name ) ) { |
| 426 | + if (!$default){ //try that, then. |
421 | 427 | $class_name_orig = $class_name; |
422 | 428 | $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' ); |
423 | | - if ( class_exists( $class_name ) ) { |
424 | | - $this->setVal( 'form_name', $this->getGatewayGlobal( 'DefaultForm' ) ); |
425 | | - } else { |
426 | | - throw new MWException( 'Could not find form ' . $class_name_orig . ', nor default form ' . $class_name ); |
427 | | - } |
428 | 429 | } |
| 430 | + |
| 431 | + if ( class_exists( $class_name ) ) { |
| 432 | + $this->setVal( 'form_name', $this->getGatewayGlobal( 'DefaultForm' ) ); |
| 433 | + } else { |
| 434 | + throw new MWException( 'Could not find form ' . $class_name_orig . ', nor default form ' . $class_name ); |
| 435 | + } |
| 436 | + } |
429 | 437 | |
430 | | - $this->setVal( 'form_class', $class_name ); |
431 | | - } |
| 438 | + $this->setVal( 'form_class', $class_name ); |
432 | 439 | } |
433 | 440 | |
434 | 441 | /** |