Is there a way to clone a fillpdf form to a different site?

Created on 17 April 2023, about 1 year ago
Updated 18 April 2023, about 1 year ago

Problem/Motivation

Here is our situation:

We have production site with multiple PDFs that has been live for a couple years. For past few months we have been working on a new version of the site that adds a pile of new fillpdf forms (as well as lots of other new features).

Our migration from dev to prod is:
- new code.. its code.. so that's easy
- config - Drupal 9, so that's now easy as well
- some special content related to new features such as terms, a few nodes and some other entities: this is still messy for sure. We are using a module called Default Content Deploy which exports/imports content of any entity type or specific entities. But references are not handles so we think this will need to be manually sorted out. small nightmare #1
- fillpdf forms: no idea!!

Default Content Deploy can export all the content entities here: forms and fields and import these.. but it doesnt resolve the attached tpl file. We would hope to simply import our new forms with fields and then see no tpl attached and just go in and upload our tpl.. but fillpdf doesnt allow this and wsod when trying to edit the imported form.

Is there some way to migrate our new fillpdf forms (with the dozens of fields for each) to our Prod site?

We have tried the export/import form the UI that comes with fillpdf but dont get how that works. It uses abs urls which dont match target site but even if we do a copy/replace it still doesnt resolve fids.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

5.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada liquidcms

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @liquidcms
  • πŸ‡¨πŸ‡¦Canada liquidcms

    sure enough.. 5 min after posting.

    certainly not the right way but i think hints at how this could work better with code changes.

    so after running Default Content Deploy drush command to import all the fillpdf entities we do get them all listed as forms in fillpdf; but, as mentioned, without any "Location" (i.e. attached tpl). If we try to edit we get:

    Error: Call to a member function getFileUri() on null in Drupal\fillpdf\Form\FillPdfFormForm->form() (line 279 of E:\www\Noah\main\web\modules\contrib\fillpdf\src\Form\FillPdfFormForm.php)

    work-around: simply went to fillpdf_forms table and put an existing file_target_id into all the records which have no value. do a cache rebuild, refresh fillpdf form listing page and sure enough all the new/busted ones now show up with that tpl; but more importantly, i am able to edit and all the fields remain intact (I assumed it would scan the new tpl and wipe all my field definitions; but it does not). I can now upload the correct tpl and save and all is well.

    I would think there is likely a simple fix here to check first if a file_target_id and if not, still allow editing.

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    It sounds like you've found a simple fix that would make this work better.

Production build 0.69.0 2024