orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 220 forks source link

Attachments to section templates are not re-published #3170

Closed avernet closed 3 years ago

avernet commented 7 years ago

To reproduce, with Form Runner setup to use a RDB (say MySQL):

  1. In Form Builder, create a form a/library, add a static image, publish it. Create a form a/a, add the section template, publish it, load a/a/new ⇒ all good.
  2. Update a/library, change the image, publish it. Back to a/a, click on the green reload icon to update the section template ⇒ the image shows broken (404).

The 404 is because we try to retrieve the image with version 1, while it is stored as version 2 in the database.

Since we embed the section template into the form on publish, we should also copy attachments part of the section template where we store the published form (crud/a/a/form/123.bin), as the published form shouldn't have a dependency on the published section template (crud/a/library/form/123.bin).

I would suggest that, when in Form Builder the template is added or updated (not when publishing), we copy attachments part of the template along the form data. This way they will be automatically copied in the right place, and with the right version, when the form is published.

+1 from community

ebruchez commented 3 years ago

Duplicate of the newer #4919. Keeping the latter as we have more information there.