Description
Submissions which include media files are shown in the API as in the picture below.
Media files can be accessed via ‘_attachments’ ‘filename’.
As soon as the original submission is edited and re-submitted, the API shows the following:
The ‘_uuid’-part of ‘filename’ has changed following the change of the ‘_uuid’ itself.
As a result, the link to the ‘_attachments’ ‘filename’ does not work anymore, because the media file seems to remain at its original place. This can be proven by applying the link of the original submission, which still works.
(As a workaround, you may replace the ‘_uuid’-part with the tag ‘meta/depreciatedID’, but after a second re-submission the reference to the original is definitely not available anymore.)
Steps to Reproduce
-
Test the link of the original submission, generated from ‘attachments’ ‘filename’ – you may access the media file (keep the link for later)
-
Edit any field of the submission (of course except the media file itself) and resubmit it.
-
Test the link of the re-submitted record, again generated from the new parameters of ‘attachments’ ‘filename’ – access to the media file will fail.
-
Use the link from the original submission. – It will work.
-
Download (Export media attachments (zip)) via UI: while the mediafiles of unedited submissions will be exported as expected, the mediafiles of edited(re-submitted) submissions will be missing in the zip-file.
Expected behavior
It is intended to generate the link to media files using ‘_attachments’ ‘filename’ even after resubmission of records.
UI-generated exports should include all files, including those of edited submissions.
Actual behavior
After re-submission (editing), the link to the media file is incorrect. The correct link remains the same as for the original submission.
Your environment:
The forms are at on https://eu.kobotoolbox.org.
The tests were conducted from various computers and different users. We’ve also tried with different forms and different form-owners. The result is the same in all environments.