We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Changed behaviour 2.6.1 clone entry in Safecracker ?

Development and Programming

icebreaker's avatar
icebreaker
50 posts
12 years ago
icebreaker's avatar icebreaker

To clone an entry it was sufficient to set hidden field with name: entry_id=”“. This seems no longer to be true. Anybody else experienced the same ? Any fix?

       
travisb's avatar
travisb
172 posts
12 years ago
travisb's avatar travisb

I’m seeing the same. Anyone have a solution?

       
travisb's avatar
travisb
172 posts
12 years ago
travisb's avatar travisb

I’ve confirmed that this is a deliberate change in EE for 2.6.1 for security issues. I don’t have an answer for how to duplicate now, but it looks like it will take some php work. Hopefully someone else will have a solution!

       
icebreaker's avatar
icebreaker
50 posts
12 years ago
icebreaker's avatar icebreaker

Very good - I suspected as much, but is nice to get that confirmed. Cloning is basic functionality and a real time saver. Should be worth the effort to resolve.

       
travisb's avatar
travisb
172 posts
12 years ago
travisb's avatar travisb

Here’s what I’m doing for now until I find something better.

Embed the info from the entry you want to duplicate as a form within the parent SafeCracker page. Something like:

-----
PARENT
-----

{exp:safecracker channel="my_channel"}

    {embed="my_tpl_group/my_form" copy_from_entry_id="123"}

    
        <button id="form_submit" type="submit" class="">Duplicate Program</button>
    

{/exp:safecracker}


-----
EMBED
-----

{exp:channel:entries channel="my_channel" entry_id="{embed:copy_from_entry_id}" }

    {!-- Output the pre-filled form of the entry you are wanting to duplicate --}
    
        <label for="program_number">program_number</label>
        <input type="text" name="program_number" id="program_number" value="{if program_number}{program_number}{/if}">
    

    <input type="hidden" name="program_start_date" id="program_start_date" value="{if program_start_date}{program_start_date format='%F %d, %Y'}{/if}">

    .....etc.....

{/exp:channel:entries}
       
icebreaker's avatar
icebreaker
50 posts
12 years ago
icebreaker's avatar icebreaker

Very good start. I’ll have to think a bit on how best to automate. Not time for that right now, but will come back if I find another solution.

       
Elemento, Inc.'s avatar
Elemento, Inc.
57 posts
12 years ago
Elemento, Inc.'s avatar Elemento, Inc.

Good approach. Any luck on these? specifically cloning matrix fields via safecracker? So far I got it to copy only the first row by manipulating the field_id_29[row_order][] and

       
Okapi Creative's avatar
Okapi Creative
382 posts
11 years ago
Okapi Creative's avatar Okapi Creative

This method with the embed works but does not allow for Inline Error reporting - did you ever figure out a better way of doing this front-end cloning? Or have an idea how to get error reporting functioning?

       
Elemento, Inc.'s avatar
Elemento, Inc.
57 posts
11 years ago
Elemento, Inc.'s avatar Elemento, Inc.

A better approach would be to use stash http://devot-ee.com/add-ons/stash

Using stash, you pull the variable and load them to the form individually.

       
Okapi Creative's avatar
Okapi Creative
382 posts
11 years ago
Okapi Creative's avatar Okapi Creative
A better approach would be to use stash http://devot-ee.com/add-ons/stash Using stash, you pull the variable and load them to the form individually.

Hmm - a different approach… so it would be not so much strictly a clone but rather using Stash to get the data for each field from a specific entry ID and populating a blank Channel Form’s fields to make a new entry? Interesting…

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.