• Resolved Zougou

    (@zougou)


    Hi,

    Each time i update a page or a post with Elementor, I get a PHP error in hoster log.

    PHP Warning: Attempt to read property "post_type" on null in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/src/integrations/third-party/elementor.php on line 155, referer https://mysite.fr/wp-admin/post.php?post=1234&action=elementor

    I guess this is coming from the Yoast Elementor Panel.
    Is this a known issue ? Is there a fix ?

    Also, is it possible to deactivate this yoast panel in elementor ? I’d prefer set Yoast options from the wp default backend.

    I’m running :
    – WP 5.8.1
    – PHP 8.0
    – YOAST SEO : 17.2.1
    – ELEMENTOR : 3.4.4

    Thanks in advance
    Regards

    • This topic was modified 4 years, 8 months ago by Zougou.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello Zougou,

    Thanks for reaching out regarding that error. The Yoast SEO plugin does not have an option to disable the Elementor integration. However, you mentioned using version 17.2.1 of our plugin.

    Does the issue resolve if you update to Yoast SEO 17.3? We look forward to hearing from you.

    Thread Starter Zougou

    (@zougou)

    Hi Maybellyne,

    I just updated Yoast to 17.3 and the PHP error still occurs.
    If it’s not possible to disable Yoast Elementor Inetgration, can you please tell me which lines of core files I should put in comment to avoid loading Yoast Elementor Panel ?

    I don’t know if this is relative, but I also got some PHP errors when exporting Yoast settings :

    Warning: Undefined array key 0 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 1 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 2 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 3 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 4 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 5 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 6 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 7 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    Warning: Undefined array key 8 in /xxx/mysite.fr/wp-content/plugins/wordpress-seo/admin/class-export.php on line 128
    • This reply was modified 4 years, 8 months ago by Zougou.
    • This reply was modified 4 years, 8 months ago by Zougou.
    Thread Starter Zougou

    (@zougou)

    Found this : https://ww.wp.xz.cn/support/topic/trying-to-get-property-post_type-of-non-object-9/

    Seems to be relative to my problem by updating page/post with Elementor

    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for the feedback, Zougou.

    Indeed, we had an open issue that was resolved in Yoast SEO 16.0. Our developers have confirmed there might be a regression.

    Our product team will assess the severity of this problem in relation to other open bug reports and new features. Based on their assessment, the bug report will be given a priority level. Our developers work on the highest priority issues first. Unfortunately, this means we cannot give you an estimate of when they’ll start working on your report.

    If you have any further information that may affect the prioritization or help our development team solve this bug, please feel invited to reply to this forum topic.

    Thread Starter Zougou

    (@zougou)

    Thanks for your answer. Of course I do understand priority level for fixing bugs.

    If I can avoid to load yoast panel tab, I suppose this error won’t show up anymore.

    Can I adapt core file /src/integrations/third-party/elementor.php to prevent the loading of yoast panel ?

    /**
    * Registers our Elementor hooks.
    */
    public function register_elementor_hooks() {
    if ( ! $this->display_metabox( $this->get_metabox_post()->post_type ) ) {
      return;
    }
    
    \add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'init' ] );
    
    // We are too late for elementor/init. We should see if we can be on time, or else this workaround works (we do always get the "else" though).
    if ( ! \did_action( 'elementor/init' ) ) {
      \add_action( 'elementor/init', [ $this, 'add_yoast_panel_tab' ] );
    }
    else {
      $this->add_yoast_panel_tab();
    }
    \add_action( 'elementor/documents/register_controls', [ $this, 'register_document_controls' ] );
    }

    While you can edit the core files of our plugin, we don’t recommend it as whenever you’ll update the plugin, all the customization will disappear.

    So, if you’re familiar with WordPress hooks and actions, you might want to consider customizing it on your own. We are afraid to say that we won’t be able to guide you on this as it goes beyond the scope of our support.

    Thread Starter Zougou

    (@zougou)

    Hi,
    Thanks for your reply.
    I’m not enough familiar with WP hooks to achieve that, so I’ll wait for a fix 🙂

    Have a nice day,
    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘PHP error when updating page with Elementor’ is closed to new replies.