I just noticed that the demo server is messed up. Whenever you look at the patient dashboard for any patient, there’s a stack trace.
Here’s a snippet of that stack trace from sshing into the machine and looking at the tomcat logs:
Caused by: java.lang.NullPointerException
at org.openmrs.ui.framework.FormatterImpl.format(FormatterImpl.java:166)
at org.openmrs.ui.framework.FormatterImpl.format(FormatterImpl.java:70)
at org.openmrs.ui.framework.UiUtils.format(UiUtils.java:393)
at org.openmrs.module.coreapps.fragment.controller.visit.ParserEncounterIntoSimpleObjects.parseObs(ParserEncounterIntoSimpleObjects.java:134)
at org.openmrs.module.coreapps.fragment.controller.visit.ParserEncounterIntoSimpleObjects.parseObservations(ParserEncounterIntoSimpleObjects.java:102)
at org.openmrs.module.coreapps.fragment.controller.visit.VisitDetailsFragmentController.getEncounterDetails(VisitDetailsFragmentController.java:132)
I got as far as seeing that the error seems to come from this line.
I guess that someone has configured an unexpected concept (or a form pointing to an unexpected concept) but even if so, that should not break the patient dashboard for all patients. I.e. there’s probably a strange configuration that we should revert, but this has also highlighted a bug in the code.
How should we fix the demo server? Should we do a refapp 2.5.1 maintenance release that just includes a bugfixed uiframework module, and deploy this to the demo server?
Should we just find and delete the concept in question?
Hmm, so the problem on the demo server was that the admin user’s default locale was set to Spanish (and this revealed the bug that Daniel linked to the commit for).
I actually don’t understand how the language got set to Spanish, because there’s a DB trigger that should prevent editing the admin user (mentioned here). I temporarily disabled the trigger, changed the admin user’s default locale to English UK, and re-enabled the trigger. And now the patient dashboard is working again.
If anyone knows how the admin user’s default locale is being changed, I’m curious!
But it was being set to this value automatically on login every time. So I think the problem must have been the default locale. (And the problem also resolved when I changed the default locale.)