Support » Plugin: Disable Downloadable Repeat Purchase - WooCommerce + WPML » id was called incorrectly. Product properties should not be accessed directly

  • Resolved dov123

    (@dov123)


    error
    get_id was called incorrectly.Product properties should not be accessed directly. Backtrace: require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘wp_loaded’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WC_Cart->init, WC_Cart->get_cart_from_session, WC_Product->is_purchasable, apply_filters(‘woocommerce_is_purchasable’), WP_Hook->apply_filters, call_user_func_array, som_disable_repeat_purchase, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong. This message was added in version 3.0.

    i found https://github.com/woocommerce/woocommerce/issues/14369
    Accessing directly product data is not allowed, e.g. $product->id. Correct method going forward is $product->get_id().

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author pwallner

    (@pwallner)

    Thx for info, will be checked and corrected.

    Any update on this? it’s completely spamming my error logs.

    Plugin Author pwallner

    (@pwallner)

    It should be solved right now!

    Thread Starter dov123

    (@dov123)

    Thank you
    but i now get a new PHP Warning on the error log

    [26-Aug-2017 18:09:09 UTC] PHP Warning: fopen(/home/public_html/wp-content/plugins/disable-downloadable-repeat-purchase/som-disable-repeat-download.php): failed to open stream: No such file or directory in /home/glorysha/public_html/jew10/wp-includes/functions.php on line 4785
    [26-Aug-2017 18:09:09 UTC] PHP Warning: fread() expects parameter 1 to be resource, boolean given in /home/public_html/wp-includes/functions.php on line 4788
    [26-Aug-2017 18:09:09 UTC] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /home/public_html/wp-includes/functions.php on line 4791

    Plugin Author pwallner

    (@pwallner)

    Cache Problem?

    I renamed the php (old som-disable-repeat-download.php), you can try do deactivate the Plugin, remove it and reinstall it.

    Regards
    Patrick

    Thread Starter dov123

    (@dov123)

    Thank you very much and works great

    Plugin Author pwallner

    (@pwallner)

    You are welcome, thx for reporting!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘id was called incorrectly. Product properties should not be accessed directly’ is closed to new replies.