Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate rendering when SubmissionStep.form_step is None (on 2.0.0+) #2305

Open
Tracked by #4942
sergei-maertens opened this issue Nov 4, 2022 · 3 comments
Open
Tracked by #4942

Comments

@sergei-maertens
Copy link
Member

Follow up from #2135

The patch for 2135 is a temporary fix where we record the historical form step data.

We need to check if we can drop most of that patch and get by with nullable SubmissionStep.form_step fields because the data is now
actually recorded in SubmissionValueVariable instances.

These have nullable form_variable references, in case the form gets edited to not affect existing submissions. At first look, it doesn't seem that the type information is then (still) available, and it's mostly relevant to check how this affects exports (to XML, CSV, JSON...).

We should especially check how complex component types behave when rendering for export again after deleting a form step, with:

  • file uploads (single + multiple)
  • textfield (single + multiple)
  • map component with coordinates
  • repeating groups

Additionally, we need to check how other registration backends react to this - they should still be able to properly register (in case manual registration is retried).

/cc @joeribekker

@sergei-maertens
Copy link
Member Author

#2306 adds an extra dimension to this problem

sergei-maertens added a commit that referenced this issue Nov 21, 2022
…iable data present

The form step relation is deleted before creating the export, simulating
the problematic situation.
@sergei-maertens
Copy link
Member Author

While writing some tests I had to go back to check what the current behaviour is for exports (tested XML and CSV) to establish a baseline

XML

attachments/file uploads are present

    <field name="fileSingle">
      <value>
        <value name="url">https://<redacted>/api/v2/submissions/files/fa32ed92-eb0f-4d35-b74b-42bd093d57f5</value>
        <value name="data">
          <value name="url">https://<redacted>/api/v2/submissions/files/fa32ed92-eb0f-4d35-b74b-42bd093d57f5</value>
          <value name="form"></value>
          <value name="name">sample.pdf</value>
          <value name="size">16512</value>
          <value name="baseUrl">https://<redacted>/api/v2/</value>
          <value name="project"></value>
        </value>
        <value name="name">sample-402da244-ec9b-468c-878e-c2d840ded486.pdf</value>
        <value name="size">16512</value>
        <value name="type">application/pdf</value>
        <value name="storage">url</value>
        <value name="originalName">sample.pdf</value>
      </value>
    </field>

map coordinates are present

    <field name="mapSingle">
      <value>52.364</value>
      <value>4.8913</value>
    </field>

repeating groups are weird

I entered two items, only one is in the export

    <field name="tekstInHerhalendeGroep">
      <value>Herhalende groep 2</value>
    </field>
    <field name="datumInHerhalendeGroep">
      <value>2022-11-26</value>
    </field>

file/text multiple

ok

CSV

files

written as a string representation of the python datastructure:

"[{'url': 'https://<redacted>/api/v2/submissions/files/fa32ed92-eb0f-4d35-b74b-42bd093d57f5', 'data': ...}]"

map

written as string repr of python datastructure:

"[52.364, 4.8913]"

repeating groups

Also weird:

  • headers are repeated for every item in the group (2 items, 2x headers)
  • values are comma separate: item1.value1, item1.value2, item2.value1, item2.value2

@sergei-maertens
Copy link
Member Author

Blocking this until we've figured out what to do with the exports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants