Hi,
when I make a change in a page in CMS and then duplicate this page (right mouse click in the tree -> Duplicate), then the page is duplicated first and then original one is saved. The original is saved, because the selection in the page tree is changed. The new page does not contain the last change, so the pages differ.
I wanted just to add autoSave(true) in the
CMSMain_left.js -> TreeContextMenu -> 'Duplicate this page' : function()
, but it didn't work, so I made two changes. First, in the CMSMain_left.js:
'Duplicate this page' : function(treeNode) {
autoSave(true, treeNode.duplicatePage.bind(treeNode));
},
and the second in the LeftAndMain_left.js:
TreeNodeAPI.prototype = {
duplicatePage : function() {
new Ajax.Request(baseHref() + 'admin/duplicate/' + this.getIdx() + '?ajax=1', {
method : 'get',
onSuccess : Ajax.Evaluator,
onFailure : function(response) {
errorMessage('Error: ', response);
}
});
},
Now, the page is first saved, and then duplicated.