Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    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?

    Thread Starter saral

    (@saral)

    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

    Thread Starter saral

    (@saral)

    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”.

    Thread Starter saral

    (@saral)

    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”;

    Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    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.

    Thread Starter saral

    (@saral)

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

    -Sara

    Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

    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.

    Thread Starter saral

    (@saral)

    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”;

    Plugin Contributor Daniel Bachhuber

    (@danielbachhuber)

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Edit Flow] saving in html mode sets post_status to pending or draft’ is closed to new replies.