Failed during the form "contact:person:create" rendering : undefined

I made changes to tasks.js and uploaded using cht-conf. During the upload I received this warning but (unwisely?) overwrote the configuration.

INFO Starting action: upload-resources… 
WARN Cannot build list of attachments from non-existent dir: /Users/joshua/Documents/GitHub/sapphire_cht/resources 

[1] Overwrite the changes
[2] Abort so that you can update the configuration
[3] View diff

You are trying to modify a configuration that has been modified since your last upload. Do you want to? [1, 2, 3]: 3
-  _rev: "2-829966961db41474c748a7af216a22ed"
   resources: {
-    icon-area: "icon-places-CHW-area@2x.png"
-    icon-branch: "icon-places-clinic@2x.png"
-    icon-calendar: "icon-calendar.png"
-    medic-person.svg: {
-      content_type: "image/svg+xml"
-      revpos: 1
-      digest: "md5-8HoRGS0ihs2qwbg+N4Gmiw=="
-      length: 435
-      stub: true
-    }
-  }

The person who originally configured our CHT app is away. I used his GitHub repo which had an empty resources.json but perhaps the default resources.json was used at some point?

Now when I try to create any form I get an error like this:
Failed during the form “contact:person:create” rendering : undefined

I tried copying resources.json and /resources from cht-core/config/default and rerunning cht-conf but I still get the same errors.

Any help would be greatly appreciated!

Hi @jschwab77

Can you please share which version of cht-core you are running? We had a bug where forms were not correctly processed because of container restarts: API Changes watcher skips changes - or becomes blocked · Issue #8173 · medic/cht-core · GitHub
The issue was fixed in 4.2. As a workaround you can try restarting the API container.

Thank you very much for your help. We were running 4.1.0. Restarting the API container fixed the problem on my browser, although I did have to reset the browser cache. Do you know if the CHWs will need to reset the cache on their phones?
We just upgraded to 4.2.2.

Resetting browser cache should not be necessary, you would just have to sync.

Thanks again for your help. The app is working fine for the CHWs now.

1 Like