Updating a favorite prescription fails silently to the user.
Steps to replicate:
1) Add a prescription to a patient.
2) Click on the link to that prescription and click the "add as a favorite" button
3) Click "Edit" next to the favorites box in the sidebar
4) Make some changes to the prescription you favorited
5) Click "Save changes"
Expected result: Text "Changes saved!" appears shortly afterward and favorite is modified
Actual result: Changes are not saved. Error is logged in catalina.out. If window is closed and reopened, favorite has not been modified.
This behavior was observed in feb2014-alpha #14, it was not present in 12.1.1 #360.
Relevant catalina.out messages:
2014-03-25 20:18:58,602 ERROR [DbConnectionFilter:68] Unexpected error.
javax.servlet.ServletException: java.lang.NullPointerException
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
[.....]
Mar 25, 2014 8:18:58 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
at oscar.oscarRx.data.RxPrescriptionData$Favorite.syncFavorite(RxPrescriptionData.java:2069)
at oscar.oscarRx.data.RxPrescriptionData$Favorite.Save(RxPrescriptionData.java:2059)
at oscar.oscarRx.pageUtil.RxUpdateFavoriteAction.ajaxEditFavorite(RxUpdateFavoriteAction.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
[...]
Diff:
https://source.oscartools.org:8080/#/c/10185/
please check this bug against master..abandoning existing commit, it's too out of date, and has some extra changes in there challenging it's code review
https://source.oscartools.org:8080/10185
The issue is still present in Master (build# 2236).