Closed (outdated)
Project:
FillPDF
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jun 2012 at 19:44 UTC
Updated:
29 May 2025 at 14:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
wizonesolutionsDefinitely want this in 7.x-2.x. I'm not sure if this will be affected by #1526496: Separate out PDF templates from mapping configurations, but I could handle that when the time came.
Comment #2
liam morlandComment #3
liam morlandComment #4
panchoGreat idea. Postpone on #1526496: Separate out PDF templates from mapping configurations though.
Comment #5
panchoNo longer postponed.
Comment #6
panchoHere's an initial patch which allows duplicating an existing FillPdfForm together with all its FillPdfFormFields and a reference to the very same template File entity. Only the admin_title gets a "Duplicate of" prepended, otherwise it's a 1:1 copy with all settings and field mappings.
Still some tests needed, otherwise this already seems to work flawlessly... :)
In a followup, we might want to move parts of the logic for creating a brandnew FillPdfForm, which is currently buried within FillPdfOverviewForm::submit() and InputHelper, to the new FillPdfFormController as well, but that's out of scope here.
Alternatively, we could turn the controller into a confirmation form and ask for the new admin_title. This way we would mirror Views UI duplicate functionality. One or the other is fine and not too much work. So we can just do what is considered a tad better Usability-wise. For that I'd need some input.
Comment #7
liam morlandIt makes sense to me to mirror what Views is doing.
Comment #8
panchoFine, so here's a version that implements a confirm form asking for the duplicate's admin_title.
To work around Core issue #2582295: Confirmation cancel links are incorrect if installed in a subdirectory, I implemented Webform's #2899166: WORKAROUND: Issue #2582295: Confirmation cancel links are incorrect if installed in a subdirectory, adding a @todo so it may hopefully be removed one day.
Comment #9
panchoHere's the same with a test and screenshots:
Confirm form:

Comment #11
panchoCommitted after fixing a minor issue in routing.yml.
I was too fast for the testbots to get the patches tested, but branch tests are passing, see here and here.
Comment #12
panchoLet's backport this to D7. It's a great, simple alternative to exporting and importing, if you just need a duplicate.
Comment #13
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.