1

Before updating to latest EE version 2.6.1, setting title and url-title to new values + setting hidden input field with name "entry_id" to '' on a safecracker edit entry form would generate a clone. Now instead the new entry simply overwrites the original one. What else is needed?

Being able to clone entries is a huge time saver, so I would really appreciate an answer on where to look to get this working again.

1
  • I've confirmed that this is a deliberate change in 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! Jun 11, 2013 at 16:05

1 Answer 1

1

Here's my workaround answer for post EE 2.6.1, not ideal, but seems to be working:

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"}

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

{/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 --}
    <p>
        <label for="program_number">program_number</label>
        <input type="text" name="program_number" id="program_number" value="{if program_number}{program_number}{/if}">
    </p>

    <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}
1
  • This embed method works but with Channel Form it breaks inline error reporting which I need. Am thinking maybe of trying with Stash. Did anyone ever find a more robust method than this embed one?
    – segovius
    Oct 29, 2014 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.