Community Health Toolkit

Tasks not appearing

Hi!

I am not able to see any tasks, neither built-in default tasks as well as the ones I made myself.
For example I filled delivery form and choose alive and unwell in this form so it should initiate task to fill the form: pnc-danger-sign-follow-up-mother but that’s not happening. Also I made two forms of my own and tried to create task which opens another form when one is finished and it failed too.

I tried to debug inserting console.log() to tasks.js in different kind of tasks, but in console I could not not see any of my logs. I enabled debug mode in app and gave all the permissions to every role as it was suggested in documentation.

Maybe it is helpful that in console there is a following error displayed:

Thank you for any advice!

  • Instance: local
  • Browser: Chrome
  • Client platform: Windows subsystem Ubuntu
  • App: webapp
  • Version: 3.7.0, master

Regards
Tamor

Hi Tamor,

The tasks are probably not showing up because of the error shown in the console.
Thanks for attaching the console error. Looks like your task is expecting some object with type attribute in it. But the object itself is in an undefined state, that is never set. It could be getting a non-existent/malformed report or contact. Reports generally have type = data_record, whereas contacts can be one of the types: person, clinic, health_center, district_hospital, or anything else defined as a place type.

As you have mentioned, you have added two forms of your own and tried to create a task. When you remove the extra reports (no need to remove the forms), and extra task logic that you have added, do you still see the same error in the console?

The console.log() should work. Can you please try again by inserting it at the first line of your tasks.js? You might also find debugger; statement useful.

Thanks

Thank you for the quick answer!

You were right that application starts to work properly when I remove extra reports.

I checked from database and my report has the type data_record. I do not believe that any parameter could be wrong or missing for data records since they look similar to working data records.

I tried this: I made an exact copy of death_report and uploaded it as death_report2 but the application continued to malfunctione as before so it seems that the mistake is somewhere else than in my form. I also used only default tasks and targets.

I did not mention before, that targets also stop working when I fill new selfmade report. It just displays loading image.

In console there were various other errors and they occurred quite randomly, for example:

  • Error getting tasks TypeError: Cannot read property ‘dueDate’ of undefined
  • Error fetching targets TypeError: Cannot read property ‘dueDate’ of undefined
  • tasks.resolvedIf is not a function etc

I still struggle with getting those tasks working so I appreciate any help.

Hi Tamor,

When making a copy of death_report as death_report2, did you also change the form_id in settings tab of the XLS form?

Thanks