• Hi,

    After the latest update, I am getting a couple of PHP notices in my debug.log

    PHP Notice:  Trying to get property 'ID' of non-object in [path]\wp-content\plugins\woo-advanced-product-size-chart\admin\class-size-chart-for-woocommerce-admin.php on line 226
    PHP Notice:  Trying to get property 'post_type' of non-object in [path]\wp-content\plugins\woo-advanced-product-size-chart\admin\class-size-chart-for-woocommerce-admin.php on line 227

    Please review and guide OR fix.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Dotstore

    (@dots)

    Hello Koolpal,

    Thanks for reaching out to us.

    Can you please add the below code at the line no after 225 at the mentioned file in the notice.
    //check if the post is object otherwise you’re not in a singular post
    if( !is_object($post) )
    return;

    After adding the above code please clear the changelog and after that let us know still you getting any notice.

    Thanks,

    Thread Starter KoolPal

    (@koolpal)

    @dots

    Thanks. Your code snippet worked.

    Added as shown below

    However, will your next update carry this code, else I will face the problem again.

    Please confirm.

    Thanks

    Plugin Author Dotstore

    (@dots)

    Hello Koolpal,

    Thanks for the update and we are happy that the given solution is working for you.

    Sure, we will implement a given solution in our next release update so, no need to worry about the next update. just enjoy!!! ??

    Thanks,

    Thread Starter KoolPal

    (@koolpal)

    @dots

    Thanks a lot. You may want to also update Woocommerce version 4 support

    P.S.: For some weird reason I do not get email updates for this particular plugin topics even though I have ticked Notify me of follow-up replies via email

    I have raised the question here: https://www.ads-software.com/support/topic/not-working-notify-me-of-follow-up-replies-via-email/#post-12559393

    Thread Starter KoolPal

    (@koolpal)

    @dots

    I am on

    WooCommerce version: 4.2.0
    WordPress version: 5.4.2
    Advanced Product Size Charts for WooCommerce Premium by theDotstore – 2.0.4

    I am still getting the error

    PHP Notice:  Trying to get property 'ID' of non-object in [path]\wp-content\plugins\woo-advanced-product-size-chart\admin\class-size-chart-for-woocommerce-admin.php on line 226
    PHP Notice:  Trying to get property 'post_type' of non-object in [path]\wp-content\plugins\woo-advanced-product-size-chart\admin\class-size-chart-for-woocommerce-admin.php on line 227

    Please fix else I will need to keep changing the code directly in your plugin.

    Thanks

    Thread Starter KoolPal

    (@koolpal)

    @dots Please fix this issue within the plugin code!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘PHP Notices seen’ is closed to new replies.