Uploaded image for project: 'HTML Form Entry Module'
  1. HTML Form Entry Module
  2. HTML-327

NullPointerException for boolean obs style=checkbox

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Won't Fix
    • Affects Version/s: HTML Form Entry 1.8.1, HTML Form Entry 1.9.0
    • Fix Version/s: HTML Form Entry 1.9.1
    • Labels:
    • Complexity:
      Undetermined

      Description

      I have an obs tag in my form with style="checkbox", like so:

      <obs conceptId="57" labelText="Is followup?" style="checkbox" />

      When I view the encounter it throws a null pointer exception, copied below.

      It also happens for style="checkbox" value="false". All the yes_no/dropdown permutations work fine.

      Error message: ============
      java.lang.NullPointerException
      org.openmrs.module.htmlformentry.FormEntryContext.removeExistingObs(FormEntryContext.java:483)
      org.openmrs.module.htmlformentry.element.ObsSubmissionElement.prepareWidgets(ObsSubmissionElement.java:179)
      org.openmrs.module.htmlformentry.element.ObsSubmissionElement.<init>(ObsSubmissionElement.java:159)
      org.openmrs.module.htmlformentry.handler.ObsTagHandler.getSubstitution(ObsTagHandler.java:31)
      org.openmrs.module.htmlformentry.handler.SubstitutionTagHandler.doStartTag(SubstitutionTagHandler.java:46)
      org.openmrs.module.htmlformentry.HtmlFormEntryGenerator.applyTagsHelper(HtmlFormEntryGenerator.java:291)
      org.openmrs.module.htmlformentry.HtmlFormEntryGenerator.applyTagsHelper(HtmlFormEntryGenerator.java:308)
      org.openmrs.module.htmlformentry.HtmlFormEntryGenerator.applyTagsHelper(HtmlFormEntryGenerator.java:308)
      org.openmrs.module.htmlformentry.HtmlFormEntryGenerator.applyTags(HtmlFormEntryGenerator.java:264)
      org.openmrs.module.htmlformentry.FormEntrySession.createForm(FormEntrySession.java:353)
      org.openmrs.module.htmlformentry.FormEntrySession.<init>(FormEntrySession.java:294)
      org.openmrs.module.htmlformentry.FormEntrySession.<init>(FormEntrySession.java:260)
      org.openmrs.module.htmlformentry.web.controller.HtmlFormEntryController.getFormEntrySession(HtmlFormEntryController.java:160)
      sun.reflect.GeneratedMethodAccessor2014.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:162)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:60)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:74)
      org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)
      org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:107)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mogoodrich Mark Goodrich
              Reporter:
              jriley Janet Riley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: