Force form "internalId" to match database ID
Having two different IDs is a minefield. If we can force (perhaps at form-upload time) that these values match, it will simplify things.
This may be best done at form upload time.
Turns out that fixing this will fix #3390
Would be nice to preserve URLs like http://localhost:5988/medic/_design/medic/_rewrite/#/reports/add/pregnancy, instead of http://localhost:5988/medic/_design/medic/_rewrite/#/reports/add/form:pregnancy
Seems like it might be nice to have both, but ensure (somewhere) that they are equal. Perhaps one can be generated from the other during doc upload, or as part of view generation or inside the angular service which fetches the forms from pouch.
@abbyad when uploading an XForm, do you ever set the internalId of a form different to the doc ID (minus the form: prefix? I'm thinking of mandating that they match in the upload script.
If we mandate that, please make sure to note that in the Migration Notes section of the changelog so that it is highlighted for tech leads.
This is already being enforced by the convert.sh script in medic-projects, so perhaps not a controversial change at all.
Currently, form doc IDs must be lower-case, but the ID in XML can contain upper-case chars: https://github.com/medic/medic-webapp/blob/master/ddocs/medic-client/validate_doc_update.js#L16-L33
I think this is a good goal for the longer-term, but the work required migrating current projects is not justified currently.
Not a priority - moving out of iteration.
Highlighting that we need to fix and test contact forms with respect to this issue.
Currently we get:
WARN DEPRECATED Form: clinic-create.xml Bad ID set in XML. Expected: contact:clinic:create but saw: clinic_create Support for setting these values differently will be dropped. Please see https://github.com/medic/medic-webapp/issues/3342.
Need to verify that changing the ID to resolve the warning does not remove the special considerations for contact forms.
I've already tested this with contact forms and they were fine. I changed the ID to match the internal ID and had no issues.
Great, I'll update the Standard config forms accordingly.
Hi @SCdF,
This ticket has not been touched in 90 days. Is it still relevant?
Please also ensure this ticket has a Priority, Status and Type label.(See triaging old issues for more detail)
Sounds like a nice change to do at some point
Scheduling for consideration in the next major.