Support » Fixing WordPress » Are you sure you want to do this? Please try again.

  • Resolved IM_natascha


    I was building a new post_type for my plugin and found this error on posting my first entry of this post_type.

    I found many entries in this forum, none answered satisfactingly, so I post my personal solution to my very own problem here to help those who encounter this problem in the future:

    You may find this description in GERMAN here:

    Setup: WP 3.0.4
    Plugins: only my own, all shipped plugins deleted
    Description of Error:
    Created new Posttype, wanted to fill an entry into Posttype, when “saving” the Posttype-Entry, I got to a nearly empty page with message: “Are you sure you want to do this? Please try again.” and a link back to the add-new-{posttype}-page.

    My way to find the solution:
    activate WP-DEBUG (wp-config.php)
    find error-message

    “Notice: Trying to get property of non-object in….\wordpress\wp-admin\includes\meta-boxes.php on line 17”

    look into this file and see
    $can_publish = current_user_can($post_type_object->cap->publish_posts);
    at line 17.
    Add line: echo "<pre>".print_r($post,1)."</pre>"; in front of line 17. (You may also write echo "<pre>".print_r($post_type,1)."</pre>"; as this was the only information I finally needed.)

    I saw my posttype being cut to a total length. So instead of my probably 22 characters-long-posttype wordpress only handled 20 characters of it. When wordpress wanted to insert my 22characters-long-posttype, it compared the original posttype somewhere to an cut-down one and therefore got an internal error somewhere.
    As my posttype is put together from my Plugin-unique-string and one word to describe it, I shortened this posttype-string and it worked fine.

  • The topic ‘Are you sure you want to do this? Please try again.’ is closed to new replies.