Skip to content

Commit

Permalink
Error on logging because of static call of WC_Settings_API
Browse files Browse the repository at this point in the history
  • Loading branch information
mahype committed Sep 21, 2016
1 parent eb5b212 commit 8c4f1e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
2016.*.* - version 1.1.1
* Tweaked: Checking if logger is enabled within logger function
* Tweaked: Added Actionhook 'shipcloud_shipment_tracking_change' for all tracking status changes
* Fixed: Error on logging because of static call of WC_Settings_API
* Fixed: Error 500 on calling Webhook URL

2016.09.08 - version 1.1.0
Expand Down
8 changes: 7 additions & 1 deletion components/woo/shipping-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -1596,10 +1596,16 @@ public function get_option( $key, $empty_value = null ) {
*/
public static function log( $message )
{
if( 'no' === WC_Settings_API::get_option( 'debug', 'no' ) ) {
$settings = get_option( 'woocommerce_shipcloud_settings' );

if( ! array_key_exists( 'debug', $settings ) ) {
return;
}

if( 'no' === $settings[ 'debug' ] ) {
return;
}

if ( ! is_object( self::$logger ) )
{
self::$logger = new WC_Logger();
Expand Down

0 comments on commit 8c4f1e9

Please sign in to comment.