After analysing the code, we see that it’s the issue with form field path that got generated for a specific control(here section control).
Whenever we load the form2 form from the consultation page, for some of the controls its generating invalid format of formFieldPath. While we load the form from consultation page and if we enter the obs for control id which has invalid formFieldPath, then this formFieldPath will get saved to database. While editing the form from display control then its throwing the error that shown as shown in the above screenshot . We are still trying to figure it out how it’s generating invalid formFieldPath.
Eg: Invalid FormFieldPath - Initial Medical Examination.2/80-/139-0
Valid FormFieldPath - Initial Medical Examination.2/8-0/139-0
And this is not happening every time we load the form. Its to intermittent. We see that recreating the from(by republishing, sometimes drop the section and add the section which had the problem) solving the issue.
Below is the technical approach that we have tried to fix the issue
Have a regex check while loading the form from consultation page. This would ignore the invalid formFieldPath that got generated by any chance and the control wouldn’t render in the UI.
Have the regex check in the backed before saving the formFieldPath to the database.
I am thinking UI valid is must and along with it we can have backend validation too
sure.
not sure. We couldn’t find the root cause as the issue is not consistent. But re-publishing the form has solved the issue and we no longer see the invalid form field paths.
no @angshuonline we have recently upgraded from 0.91 to 0.92. So we have not imported the form but we restored the database and forms. This could be the reason for the issue.
Do you think having the formFieldPath validation would make sure that we don’t get into this issue ?