• Resolved Andrew1977

    (@andrew1977)


    After updating to the latest version, we are now seeing the following error appearing in our error logs, on quite a few occassions (please note this error doesn’t occur in the previous version of this plugin):

    PHP Fatal error: Uncaught TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /plugins/all-in-one-seo-pack/app/Common/Traits/Helpers/WpContext.php:222

    Kind Regards,

    Andrew

    • This topic was modified 1 year, 2 months ago by Andrew1977.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Prabhat

    (@prabhatrai)

    Hi @andrew1977,

    Thanks for reaching out, and I apologize for the inconvenience caused!

    It seems that the issue is coming from a conflicting plugin/theme on your website.

    However, we’ve released a hotfix for the issue that includes a fix. We will also be including the fix in one of our future updates.

    Could you confirm if you’re able to access your WordPress Admin area? If yes, you can follow the steps below to install the beta build with the fix –

    1. Take a complete backup of your website and database.
    2. Download the AIOSEO Pro 4.3.1.2-beta from this link – https://a.supportally.com/f/3qgqRK
    3. Go to your WordPress Dashboard > Plugins > Add New, and install the above-downloaded plugin.
    4. Click on the Replace current with uploaded button.

    This should fix the issue. Please let me know if it doesn’t.

    Thanks!

    Thread Starter Andrew1977

    (@andrew1977)

    Hi @prabhatrai

    Thanks for the super quick reply!

    Can I check a couple of things:

    Is the fix just the ammended line of code on line 222 of WPContext.php, which has been changed from:

    return property_exists( $post, ‘ID’ ) ? $post->ID : null;

    to:

    return is_object( $post ) && property_exists( $post, ‘ID’ ) ? $post->ID : null;

    Also, if updating to the beta version, which you’ve kindly supplied, will all our original plugin settings be saved, or will we loose our settings and have to reapply them?

    For the time being we’ve ammended the existing plugins line of code at 222 of WPContext.php to the following:

    return is_object( $post ) && property_exists( $post, ‘ID’ ) ? $post->ID : null;

    We will keep an eye on the error log over the next 24 hours and report back.

    Thanks again for the amazing support!

    Kind Regards,

    Andrew

    • This reply was modified 1 year, 2 months ago by Andrew1977.
    • This reply was modified 1 year, 2 months ago by Andrew1977.
    Plugin Support Prabhat

    (@prabhatrai)

    Hi @andrew1977,

    Is the fix just the ammended line of code on line 222 of WPContext.php, which has been changed from:

    return property_exists( $post, ‘ID’ ) ? $post->ID : null;

    to:

    return is_object( $post ) && property_exists( $post, ‘ID’ ) ? $post->ID : null;

    Yes, the fix is precisely that.

    Also, if updating to the beta version, which you’ve kindly supplied, will all our original plugin settings be saved, or will we loose our settings and have to reapply them?

    All of your settings & data should remain the same. However, as mentioned in my previous reply, please ensure to take a full backup of your website & database before updating to the Beta version.

    Please let me know if you have any questions.

    Thanks!

    Thread Starter Andrew1977

    (@andrew1977)

    Hi @prabhatrai

    Thanks for the above confirmation.

    Your fix has resolved this for us.

    Thank you for all your help with this.

    Kind Regards,

    Andrew

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Fatal error: Uncaught TypeError: property_exists(): After last update’ is closed to new replies.