• Resolved jroberts.gd

    (@jrobertsgd)


    After installing latest Gutenberg and attempting to publish a new page, the members plugin causes a PHP notice to be printed before the Rest API JSON payload, causing the Gutenberg operation to fail.

    <br />
    <b>Notice</b>: Trying to get property of non-object in <b>xxxxxxxxxxxxxxxx/plugins/members/inc/template.php</b> on line <b>95</b><br />
    {“id”:191,”date”:”2018-02-07T10:46:29″,”date_gmt”:”2018-02-07T16:46:29″,”guid”:{“rendered”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/?page_id=191″,”raw”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/?page_id=191″},”modified”:”2018-02-07T11:01:42″,”modified_gmt”:”2018-02-07T17:01:42″,”password”:””,”slug”:”test”,”status”:”publish”,”type”:”page”,”link”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/test\/”,”title”:{“raw”:”Test”,”rendered”:”Test”},”content”:{“raw”:””,”rendered”:””,”protected”:false},”excerpt”:{“raw”:””,”rendered”:””,”protected”:false},”author”:10,”featured_media”:0,”parent”:0,”menu_order”:0,”comment_status”:”closed”,”ping_status”:”closed”,”template”:””,”meta”:[],”revisions”:{“count”:1,”last_id”:192},”_links”:{“self”:[{“href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/pages\/191″}],”collection”:[{“href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/pages”}],”about”:[{“href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/types\/page”}],”author”:[{“embeddable”:true,”href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/users\/10″}],”replies”:[{“embeddable”:true,”href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/comments?post=191″}],”version-history”:[{“href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/pages\/191\/revisions”}],”wp:attachment”:[{“href”:”http:\/\/xxxxxxxxx.xxxxxx.xxx\/wp-json\/wp\/v2\/media?parent=191″}],”curies”:[{“name”:”wp”,”href”:”https:\/\/api.w.org\/{rel}”,”templated”:true}]}}

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jroberts.gd

    (@jrobertsgd)

    Maybe something like this would help?

    
    $post = get_post( $post_id );
    
    if ( !is_null( $post ) )
      $parent_id = $post->post_parent;
    else
      $parent_id = 0;
    
    Justin Tadlock

    (@greenshady)

    Note that Gutenberg is currently in development and shouldn’t be used on a production site. It’s not a finished plugin. It sounds like the plugin might be incorrectly calling the_content filter hook outside of The Loop.

    A check wouldn’t hurt in that particular bit of code in Members, but wouldn’t address the root issue.

    Thread Starter jroberts.gd

    (@jrobertsgd)

    Justin,

    Thanks for the quick response. We’re only using this in a test environment at the moment. Do you think this might be worth opening an issue within the Gutenberg repo?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gutenberg Conflict’ is closed to new replies.