Bug with Debug and MercadoPago v. 2.0.1
-
Hi there,
I came across this issue with the MercadoPago plugin and debug mode. When it’s disabled MercadoPago may have issues contacting the site. It will return a 500 error.
Here’s the error that’s returned:
PHP Fatal error: Call to a member function add() on a non-object in wp-content/plugins/woocommerce-mercadopago/includes/class-wc-mercadopago-gateway.php on line 487
That line of code has this:
$this->log->add( $this->id, 'Received valid IPN response from MercadoPago' );
But if Debug mode is not enabled for the MercadoPago plugin, it fails and throws the error above. The reason is because of this line of code:
wp-content/plugins/woocommerce-mercadopago/includes/class-wc-mercadopago-gateway.php 66: // Active logs. 67- if ( 'yes' == $this->debug ) { 68- if ( class_exists( 'WC_Logger' ) ) { 69- $this->log = new WC_Logger(); 70- } else { 71- $this->log = WC_MercadoPago::woocommerce_instance()->logger(); 72- } 73- }
the log variable never gets created if debug mode is not turned on. If you’re having issues getting MercadoPago to communicate with your site, try turning on Debug mode. This should be fixed though. ??
- The topic ‘Bug with Debug and MercadoPago v. 2.0.1’ is closed to new replies.