Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12593

NullPointerException in plugin 'projectMgr' when listing TimeSheets

    XMLWordPrintableJSON

Details

    Description

      As already communicated via the mailing list, I am opening a ticket as requested for the following reason:

      Since version 22.01, but also on the trunk, there is a problem when listing timesheets using the form "ListFindTimeSheet" in https://github.com/apache/ofbiz-plugins/blob/trunk/projectmgr/widget/forms/TimeSheetForms.xml.

      When calling a screen that embeds this form, a NullPointerException is displayed in the table in the "set to complete" column if the row to be displayed is a TimeSheet that has already been completed.

      If I completely stupidly replace "?complete:""}{}" with "?complete:"exists"}{}" in row 134 and 148, the error disappears and a hyperlink button with the text "exists" appears. I suspect that there has been a change that causes the empty string """" to cause a NullPointerException at some point.

       
      I looked at the code you linked and realized that I expressed myself poorly. I don't think that changes at this point will cause problems. I rather think that there might have been changes in the rendering of the forms, because in OFBiz 17.x and 18.x the TimeSheets were still listed correctly and the code there also uses the empty strings (""). Possibly these empty strings are now becoming NullPointerExceptions due to a code change to the rendering.
       
      The exception informs about MacroFormRenderer:
      null at org.apache.ofbiz.widget.renderer.macro.MacroFormRenderer.makeHyperlinkByType(MacroFormRenderer.java:2918) ~[ofbiz.jar:?]
       
      Maybe the creation of the anchorElement fails because of this empty string, because the context is empty.
      final element anchorElement = WidgetWorker.makeHiddenFormLinkAnchorElement(linkStyle,
                              encodedDescription, confirmation, modelFormField, request, context);
      {{writer.append(anchorElement.outerHtml()); }}<-- NullPointerException

      Attachments

        1. OFBIZ-12593.patch
          3 kB
          Jacques Le Roux

        Issue Links

          Activity

            People

              jleroux Jacques Le Roux
              tomxpcvx tomxpcvx
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: