WordPress.org

Ready to get started?Download WordPress

Forums

Edit Flow
[resolved] saving in html mode sets post_status to pending or draft (10 posts)

  1. saral
    Member
    Posted 1 year ago #

    If we save a post while in html mode of tinymce, the post_status changes to "pending" or 'draft." This causes the post to become invisible since pending and draft are not valid custom statuses.

    Is there a work around for this?

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Did you delete your "draft" status? Are there any Javascript errors on the page? Can you provide a bit more information as to how the post_status is changing?

  3. saral
    Member
    Posted 1 year ago #

    I think my colleague replaced "draft" with "new_file" -- at least I do not see "draft" when I go to Edit Flow > Custom Statues

    No JavaScript errors.

    Here are some examples of behavior:

    If I leave the edit mode in "html" then press Add New, I get a "Save Draft" button and the post is saved as "draft" with preview generating a 404.

    If I leave the edit mode in Visual, but change the edit mode to "html" the button still says "Save" but the post is saved as "draft" and the button changes to "Save Draft" afterwards.

    If I leave the edit mode in Visual, I get a "Save" button and the post is saved as "new_file" (a custom status) and the file is visible in Preview. however, if I change the mode to "html" and save again, the status is changed to "draft" and the button says "Save Draft" afterwords.

    There appears to be a conflict with tinymce html mode and custom statuses?

    Thanks, Sara

  4. saral
    Member
    Posted 1 year ago #

    Addendum:

    If I start out and end in Visual mode, I post is saved with a post_status of "new_file" and all is well.

    If I start out or change to html mode and save in that mode, post_status is "draft".

  5. saral
    Member
    Posted 1 year ago #

    I ran the JavaScript debugger in Firebug and got this error when creating a new or updaing a post in html mode:

    TypeError: tinyMCE.settings is undefined
    [Break On This Error]

    tinyMCE.settings.advanced += ",|,add_image,add_video,add_audio,add_media";

  6. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    I'm willing to bet this issue is caused by invalid Javascript with another plugin. Your best bet would be to disable all of your plugins (but leave Edit Flow enabled), and then reenable them one by one to identify the plugin causing the problem.

    Hope this helps.

  7. saral
    Member
    Posted 1 year ago #

    Did what you suggested and isolated the "More Fields" plugin. So looks like More Fields breaks TinyMCE which in turn breaks EditFlow?

    -Sara

  8. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Yep, sounds like it. Specifically, there may already be broken Javascript on the page when "More Fields" is activated, but it just becomes obvious when Edit Flow's custom statuses are enabled.

  9. saral
    Member
    Posted 1 year ago #

    Fixed!

    If I add this line:

    if ( typeof( tinyMCE.settings ) == "undefined") {tinyMCE.settings = ""; }

    just above line 38

    if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function") {
    tinyMCE.settings.advanced += ",|,add_image,add_video,add_audio,add_media";
    tinyMCE.execCommand("mceAddControl", false, "%key%");
    }

    in "more-fields/more-fields-field-types.php" that fixes the JS "undefined" error. Apparently, this variable is not set if you are in html mode.

    TypeError: tinyMCE.settings is undefined

    tinyMCE.settings.advanced += ",|,add_image,add_video,add_audio,add_media";

  10. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 1 year ago #

    Nice work :) You might want to pass that along to the original plugin author — I'm sure she/he would appreciate the fix

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic