Form button 'Save as copy' - Option 'Default on Copy' doesn't seem to work

Borox

Member
Hi,

I used the button 'Save as copy' to quickly copy a specific form, it works but, I have a problem with the fileupload elements because the files themselves are not copied, we get an alias of the files ( the copy and the source point towards the same file).
So, I wanted to exclude the fileupload elements from the copy. In order to do that I put 'Default on Copy' to Yes upload_2018-4-13_10-50-12.pngbut the fileload elements are still copied.

1 - Is there a way to avoid the copy of a specific element when we use the button 'Save as copy'
2 - Would it be possible for fileupload element to have a real copy, I mean, a copy of the file?

Thanks.
 
I checked with another type of element, with a 'field' the option 'Default on Copy' works ( the value is not copied), so it seems that it doesn't work only (at least) with filepload.
 
Are you doing the copy from a list (using the Copy list plugin) or from the form (using the Save as Copy button)?

-- hugh
 
Thanks Hugh, the fix works great!

For the moment excluding the files from the copy is enough for me, I'll see later if I need a real copy of them.
 
I've noticed something, which happened, I think, for all the elements:

It works, the fileupload's elements are not copied, but if you send an email using the 'form email plugin', when you copy a form, you still get the values. The variable 'data' (I use $this->data[...] to put the values in the email) seems not to be update and still contains a value that you find in the email.

Do I need to use another variable then 'data'?

Thanks
 
Hmmm, yeah, I can see why that happens.

I think it's fixable. I'll take a look as soon as I get a chance this week.

-- hugh
 
Hi Hugh,

I've done a full github update but no change, I still have in the first email sent the values ( not in the next emails)
 
Hi Hugh,

Here is the code used to get the pictures in the email sent after the form copy:
Code:
echo "<img src=".JURI::base().$this->data['contrats___contrat_photo_raw'].">";

Right after the copy the picture appears, even though the files is not in the new form ( the one copied).

In the email right after the copy:
index.php


In the email after a 'save' without touching anything:
index.php


Thanks.
 
Last edited:
Hi Hugh,

It doesn't work in my case.
I used the template debug.php to see the variables and there is nothing in the non _raw one ( neither if I'm supposed to have an image or if I'm not). That's probably why I used the _raw version in the first place.

I haven't made a copy, so I was supposed to have something in non raw variable:
View attachment 17182
In the raw:
View attachment 17183

Weird.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top