Save and Copy not working correctly?

By rez - April 30, 2014 - edited: April 30, 2014

i think the latest version of save and copy-  1.05  with the latest CMSB- 2.61 (Build 1058)

erases info from your previous entry and saves it over the current. You don't notice until going back out to list view. 

Here is what happened to me:

Going down a long list of items that had categories from a different table (food menu items assigned to categories)

I filled a record, pressed save and copy and pasted new info over all my fields, leaving the category  the same. I found this faster than having to change the category with a drop menu.

When finished, all of my wysiwyg (description) fields were shifted. Wrong descriptions per item.

 I figured i did something stupid and tested a couple more and sure enough, they were all shifted, descriptions with wrong items. 

By Chris - April 30, 2014

Hi rez,

I think I have a solution. Can you try making this change to the plugin to see if it fixes the problem?

In saveAndCopy.php, change line 22:

$button = '<input type="button" name="action=save" value="' .t('Save & Copy'). '" onclick="window.SAVE_AS_COPY_CLICKED=true; $(\'form\').submit();" class="button" />';

...adding this new code:

$button = '<input type="button" name="action=save" value="' .t('Save & Copy'). '" onclick="window.SAVE_AS_COPY_CLICKED=true; $(\'form\')[0].onsubmit(); $(\'form\').submit();" class="button" />';

Does that solve the problem? Please let me know and I will patch the add on. Thanks!

All the best,
Chris