[ 
https://issues.apache.org/jira/browse/OFBIZ-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507455#comment-13507455
 ] 

Olivier Heintz commented on OFBIZ-5073:
---------------------------------------

After 2 hours :-( find the reason and maybe a solution
solution proposed :
{code}
+++ framework/widget/src/org/ofbiz/widget/WidgetWorker.java     (copie de 
travail)
@@ -289,7 +289,7 @@
                 writer.append(key);
                 writer.append("\" value=\"");
 
-                String valueFromContext = context.containsKey(key) ?
+                String valueFromContext = context.containsKey(key) && 
context.get(key)!= null ?
                         context.get(key).toString() : parameter.getValue();
                 writer.append(valueFromContext);
                 writer.append("\" type=\"hidden\"/>");
{code}

the problem is visible on ListPortalPages, which list all 
portalPage-GenericValue for one parentportalPageId received in parameters.

parentPortalPageId is a field of PortalPage-GenericValue, so context contain 
parentPortalPageid as genericValue field and in this case value is null.

I don't understand the previous patch done @Rev1392766 about OFBIZ-2628 :
{code}
-                writer.append(parameter.getValue());
+
+                String valueFromContext = context.containsKey(key) ?
+                        context.get(key).toString() : parameter.getValue();
+                writer.append(valueFromContext);
{code}
because with the @Rev1392766 patch, value will be genericValue.field and not 
the from-field form.

The solution I propose works in the ListPortalPages list, but in some other 
case @Rev1392766 patch (even with my correction) with generate wrong value.
                
> My Portal Preferences error
> ---------------------------
>
>                 Key: OFBIZ-5073
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5073
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>         Environment: demo site https://demo-stable.ofbiz.apache.org/myportal
>            Reporter: Naofumi Fukue
>
> Select My Portal > Preferences, displays bellow error.
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen 
> [component://common/widget/CommonScreens.xml#GlobalDecorator]: 
> java.lang.NullPointerException (null)
> Reverting org/ofbiz/widget/WidgetWorker.java previous latest OFBIZ-2628 bug 
> fix, then the problem recovered.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to