Search code examples
upgradeorbeon

New added field does not show in old version in Orbeon


I want to modify a form definition and upgrade all old filled form data also. But when I try to add new field, I found old input form data can not show the new field. it means I can not fill a new value in such old form data. Basically it means Orbeon does not support upgrade old form data to new definition.

Specific steps to understand such problem:

  1. Create a form with two filed: Name and Id. save such form and publish as version 1.
  2. Fill such form and save it.
  3. Open the form definition and add a new field, such as Address. Save it and Publish it. When ask publish as new one or overwritten, choose overwritten the version 1.
  4. Open the filled form data you can see there is no new Address field show up.

Maybe it's not the right way to handle upgrade old data to new definition. I think we understand my requirement anyway.


Solution

  • The recommended way to handle this is to use versioning: when you publish an incompatible version of a form definition, you publish it under a new form definition version. For example:

    • create and publish form definition with version 1
    • create form data with version 1
    • create and publish incompatible form definition with version 2
    • existing form data is read with the form definition version 1
    • new data created with form definition version 2 is read with form definition version 2

    There is currently no support for upgrading existing data from one version to the other (say version 1 to version 2). We do have an RFE for a minimal version of that.

    See also this blog post for more.