17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1604 Views |
-
autoSave before page duplicate

9 July 2007 at 1:41pm Last edited: 10 July 2007 8:22am
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
, but it didn't work, so I made two changes. First, in the CMSMain_left.js:CMSMain_left.js -> TreeContextMenu -> 'Duplicate this page' : function()
'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.
-
Re: autoSave before page duplicate

12 July 2007 at 8:52am
one of the GSOCers wish to add this to the GSOC branch? [attribute ondra]
-
Re: autoSave before page duplicate

12 July 2007 at 10:56am
I've tentatively put this on my list: Ticket #41 Apply xmedeko's "autoSave before page duplicate" fixes to gsoc branch but if anyone else would like to do this, feel free to reassign to yourself. ;)
Thanks for this xmedeko,
Elijah
-
Re: autoSave before page duplicate

12 July 2007 at 9:05pm Last edited: 12 July 2007 9:14pm
I tried to apply the patch, but it doesn't seem to work with the GSoC branch.. maybe I missed something or it works only with the latest build..
I'm working on something else at the moment, will look at that later..
I added the patched files to the ticket, but I didn't commit them yet.
-
Re: autoSave before page duplicate

13 July 2007 at 8:07am Last edited: 13 July 2007 8:25am
I've applied these changes to the gsoc branch: Apply-xmedekos-autoSave-before-page-duplicate-fixes-cms-gsoc-r38532.patch
------------------------------------------------------------------------
r38532 | elofgren | 2007-07-12 15:02:36 -0500 (Thu, 12 Jul 2007) | 1 lineWhen 'Duplicate this page' is clicked, first silently (without confirmation) save the page, then duplicate it so the new page is identical to the other page. Closes gsoc Ticket #41: Apply xmedeko's "autoSave before page duplicate" fixes to gsoc branch. Adapted from code posted here: http://www.silverstripe.com/contributions/flat/2073 Thanks Ondra\!
------------------------------------------------------------------------Thanks to Ondra for finding a solution and to everyone who looked into this,
Elijah
| 1604 Views | ||
|
Page:
1
|
Go to Top |




