Index: branches/fundraising/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -791,10 +791,17 @@ |
792 | 792 | * @param type $additional |
793 | 793 | * @param type $vars |
794 | 794 | */ |
795 | | - function saveCommunicationStats( $function = '', $additional = '', $vars = '' ) { //easier than looking at logs... |
| 795 | + function saveCommunicationStats( $function = '', $additional = '', $vars = '' ) { |
796 | 796 | $params = array( ); |
797 | | - if ( self::getGlobal( 'SaveCommStats' ) ) { //TODO: I should do this for real at some point. |
| 797 | + if ( self::getGlobal( 'SaveCommStats' ) ) { |
798 | 798 | $db = ContributionTrackingProcessor::contributionTrackingConnection(); |
| 799 | + |
| 800 | + //TODO: Actually define this table somewhere in the code, once we |
| 801 | + //are reasonably certain we know what we want to see in it. |
| 802 | + if ( !( $db->tableExists( 'communication_stats' ) ) ){ |
| 803 | + return; |
| 804 | + } |
| 805 | + |
799 | 806 | $params['contribution_id'] = $this->dataObj->getVal( 'contribution_tracking_id' ); |
800 | 807 | $params['ts'] = $db->timestamp(); |
801 | 808 | $params['duration'] = $this->getStopwatch( __FUNCTION__ ); |
— | — | @@ -803,8 +810,6 @@ |
804 | 811 | $params['vars'] = $vars; |
805 | 812 | $params['additional'] = $additional; |
806 | 813 | |
807 | | - //can we check to see if the table exists? Bah, I should almost certianly do this Fer Reals. |
808 | | - |
809 | 814 | $db->insert( 'communication_stats', $params ); |
810 | 815 | } |
811 | 816 | } |