Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error, wc-order line 256 #2101

Closed
Geczy opened this issue Dec 31, 2012 · 16 comments
Closed

Fatal error, wc-order line 256 #2101

Geczy opened this issue Dec 31, 2012 · 16 comments

Comments

@Geczy
Copy link
Contributor

Geczy commented Dec 31, 2012

( ! ) Fatal error: Cannot use object of type WP_Error as array in C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\class-wc-order.php on line 256

All I did was $order = new WC_Order( 1384 );

$terms = wp_get_object_terms( $this->id, 'shop_order_status', array('fields' => 'slugs') );

Var dumping that returns:

object(WP_Error)[470]
  public 'errors' => 
    array (size=1)
      'invalid_taxonomy' => 
        array (size=1)
          0 => string 'Invalid taxonomy' (length=16)
  public 'error_data' => 
    array (size=0)
      empty
@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

None of my orders are loading:

Undefined property: WC_Email_Customer_Completed_Order::$subject_downloadable in C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\emails\class-wc-email-customer-completed-order.php on line 157


Undefined property: WC_Email_Customer_Completed_Order::$heading_downloadable in C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\emails\class-wc-email-customer-completed-order.php on line 164


[31-Dec-2012 15:26:24 UTC] PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\wamp\www\woocommerce\wp-includes\cache.php on line 113

[31-Dec-2012 15:26:24 UTC] PHP Stack trace:

[31-Dec-2012 15:26:24 UTC] PHP 1. {main}() C:\wamp\www\woocommerce\wp-admin\post.php:0

[31-Dec-2012 15:26:24 UTC] PHP 2. include() C:\wamp\www\woocommerce\wp-admin\post.php:185

[31-Dec-2012 15:26:24 UTC] PHP 3. do_meta_boxes() C:\wamp\www\woocommerce\wp-admin\edit-form-advanced.php:397

[31-Dec-2012 15:26:24 UTC] PHP 4. call_user_func() C:\wamp\www\woocommerce\wp-admin\includes\template.php:927

[31-Dec-2012 15:26:24 UTC] PHP 5. woocommerce_order_totals_meta_box() C:\wamp\www\woocommerce\wp-admin\includes\template.php:927

[31-Dec-2012 15:26:24 UTC] PHP 6. WC_Shipping->load_shipping_methods() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\admin\post-types\writepanels\writepanel-order_data.php:557

[31-Dec-2012 15:26:24 UTC] PHP 7. WC_Shipping->register_shipping_method() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\shipping\class-wc-shipping.php:72

[31-Dec-2012 15:26:24 UTC] PHP 8. WC_Free_Shipping->__construct() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\shipping\class-wc-shipping.php:88

[31-Dec-2012 15:26:24 UTC] PHP 9. WC_Free_Shipping->init() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\shipping\class-wc-free-shipping.php:26

[31-Dec-2012 15:26:24 UTC] PHP 10. WC_Settings_API->init_settings() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\shipping\class-wc-free-shipping.php:38

[31-Dec-2012 15:26:24 UTC] PHP 11. WC_Free_Shipping->init_form_fields() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\class-wc-settings-api.php:115

[31-Dec-2012 15:26:24 UTC] PHP 12. WC_Settings_API->get_option() C:\wamp\www\woocommerce\wp-content\plugins\woocommerce\classes\shipping\class-wc-free-shipping.php:63

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

All plugins are disabled when testing ^ . On latest master branch

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

No idea what caused this. I switched themes then back to my original and it went away. So weird.

@Geczy Geczy closed this as completed Dec 31, 2012
@mikejolley
Copy link
Member

Let me check this, I'm toying with classes right now..

@mikejolley mikejolley reopened this Dec 31, 2012
@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

I'm running into this issue again, so I'm glad you reopened it.

I can replicate it by doing new WC_Order(xxx) on plugins_loaded

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

Should I swap to init or should it work on plugins_loaded?

@mikejolley
Copy link
Member

I think plugins_loaded is too early

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

Hm okay, what's odd and inconsistent to me is:

  • To load gateways, I must use plugins_loaded
  • To use WP_Orders or other classes, I must use init

Shouldn't both happen on one action?

@mikejolley
Copy link
Member

I think we've argued about this before.

CPT's need to be added at init, not before.

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

"Argued" lol

👍

@mikejolley
Copy link
Member

@Geczy
Copy link
Contributor Author

Geczy commented Dec 31, 2012

@Geczy
Copy link
Contributor Author

Geczy commented Jan 7, 2013

Edit; Ignore me

@mikejolley
Copy link
Member

The autoload - this will kick in whenever called.

@mikejolley
Copy link
Member

Might have unusual results though so beware - post types dont get defined until init

@Geczy
Copy link
Contributor Author

Geczy commented Jan 7, 2013

Definitely weird, everything's working fine on plugins_loaded throughout my classes. Unless I call new WC_Order directly in the plugins_loaded action, rather than the classes loaded from the action.

Wweeird

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants