Avoid overwriting one's content modifications
Posted: Thu Feb 28, 2013 10:41 pm
Hello Community,
a while ago I was working on two different pages of my CMSimple site in two different tabs to be able to better match them. After having saved the second, the changes in the first were lost. This could be improved by storing the mtime of content.htm in a hidden field in the edit form, and comparing that with the current mtime when submitting the form, rejecting to save the modifications, if the stored mtime is less than the current one (i.e. the file was altered in the meantime). OTOH I'm not sure, if that's necessary (perhaps nobody else is working on more than one page in parallel), and if the resulting error message might not irritate the user, or at least won't help him, as he may not know how to solve the problem (copying the modified page contents to the clipboard, reload the page [not F5, but enter in the address line] and replacing the page content with the clipboard).
What do you think?
Christoph
PS: Just noticed, that special care would have to be taken to cater for any modifications of the content, that would be done through AJAX requests (such as the quick saving of a page data tab).
a while ago I was working on two different pages of my CMSimple site in two different tabs to be able to better match them. After having saved the second, the changes in the first were lost. This could be improved by storing the mtime of content.htm in a hidden field in the edit form, and comparing that with the current mtime when submitting the form, rejecting to save the modifications, if the stored mtime is less than the current one (i.e. the file was altered in the meantime). OTOH I'm not sure, if that's necessary (perhaps nobody else is working on more than one page in parallel), and if the resulting error message might not irritate the user, or at least won't help him, as he may not know how to solve the problem (copying the modified page contents to the clipboard, reload the page [not F5, but enter in the address line] and replacing the page content with the clipboard).
What do you think?
Christoph
PS: Just noticed, that special care would have to be taken to cater for any modifications of the content, that would be done through AJAX requests (such as the quick saving of a page data tab).