Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > Editor instances marked "dirty" even when not editable View modes: 
User avatar
Member
Member
Josh Larios - 9/11/2009 12:41:10 PM
   
Editor instances marked "dirty" even when not editable
It is possible to create (via import, but possibly in other ways) pages with editable areas which contain content which FCKEditor marks as dirty immediately upon loading. When this happens, if you view the page in edit mode, even if it isn't editable (due to workflow), navigating away from that page raises the "prompt to save changes on exit" message. This is a confusing message to get in cases when you haven't made any changes.

I believe making the following change in CMSScripts\cms.js solves the problem:


function FCKeditor_OnComplete(editorInstance)
{
if (disabledFCKEditors[editorInstance.Name])
{
DisableFCKeditor(editorInstance);
editorInstance.ResetIsDirty(); // add this line
}
}


What that does is reset the dirty status after disabling the editor. With the status reset, the warning only appears if you really have made changes to the content, not when the editor has made those changes for you on first load.

User avatar
Member
Member
Josh Larios - 9/11/2009 1:40:18 PM
   
RE:Editor instances marked "dirty" even when not editable
Actually, that line should probably be inserted two lines down, after the condition block (but inside the function). That way, it gets reset even if they have the document editable. Only if they actually make a change will it be flagged as dirty and trigger the save prompt.

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 9/15/2009 4:07:40 AM
   
RE:Editor instances marked "dirty" even when not editable
Hi,

Thank you for letting us know about this issue. You are right. Unfortunately, this seems to be a bug in the current version. I'm very sorry for this inconvenience. We will try to fix this issue in next Kentico CMS version.

Best Regards,
Miroslav Remias.