[ 
https://issues.apache.org/jira/browse/OFBIZ-12593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jacques Le Roux closed OFBIZ-12593.
-----------------------------------
    Fix Version/s: 22.01.01
       Resolution: Fixed

> NullPointerException in plugin 'projectMgr' when listing TimeSheets
> -------------------------------------------------------------------
>
>                 Key: OFBIZ-12593
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12593
>             Project: OFBiz
>          Issue Type: Bug
>          Components: projectmgr
>    Affects Versions: 22.01.01
>            Reporter: Tom Pietsch
>            Assignee: Jacques Le Roux
>            Priority: Major
>              Labels: nullpointerexception, projectmgr, timesheet
>             Fix For: 22.01.01
>
>         Attachments: OFBIZ-12593.patch
>
>
> As already communicated via the [mailing 
> list|https://lists.apache.org/thread/2vo7h5tfkgr494qqjsffmyrc3g759bt7], 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



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to