You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/05/19 08:56:23 UTC

svn commit: r1340359 - in /ofbiz/branches/release11.04: ./ framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java

Author: jleroux
Date: Sat May 19 06:56:22 2012
New Revision: 1340359

URL: http://svn.apache.org/viewvc?rev=1340359&view=rev
Log:
"Applied fix from trunk for revision: 1340357  " 
------------------------------------------------------------------------
r1340357 | jleroux | 2012-05-19 08:53:58 +0200 (sam., 19 mai 2012) | 14 lines

A patch from Harsha Chadhar for "Can not add "Question Options" within the Survey section of the Content application." https://issues.apache.org/jira/browse/OFBIZ-2959

Reported by Brant Levinson 19/Sep/09 : When editing a question in Content --> Survey which has a "Selected Option" Question Type, the page does not allow for the creation of a Question Option. 

Sumit Pandint tested:
It can be reproduced in following steps -
1) Go to : https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000
OR
https://demo-trunk.ofbiz.apache.org:8443/content/control/EditSurveyQuestions?surveyId=1000&surveyQuestionId=10000&surveyQuestionCategoryId=1000#edit
2) Create New Question with "Survey Question Type Id" = "Selected Option"
3) ERROR
4) Question starts appearing in list.
5) Page rendering exception is coming in create question option section.
6) Apply patch and observe screen : OK
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1340357

Modified: ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java?rev=1340359&r1=1340358&r2=1340359&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java (original)
+++ ofbiz/branches/release11.04/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java Sat May 19 06:56:22 2012
@@ -63,9 +63,9 @@ public class HtmlFormWrapper {
         this.formName = formName;
         this.request = request;
         this.response = response;
-
+        Delegator delegator = null;
         try {
-            Delegator delegator = (Delegator) request.getAttribute("delegator");
+            delegator = (Delegator) request.getAttribute("delegator");
             LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
             this.modelForm = FormFactory.getFormFromLocation(resourceName, formName, delegator.getModelReader(), dispatcher.getDispatchContext());
         } catch (IllegalArgumentException iae) {
@@ -101,6 +101,9 @@ public class HtmlFormWrapper {
             Debug.logInfo("Got uiLabelMap: " + uiLabelMap, module);
             context.put("uiLabelMap", uiLabelMap);
         }
+        if (UtilValidate.isNotEmpty(delegator) && context.get("delegator") == null) {
+            context.put("delegator", delegator);
+        }
     }
 
     @SuppressWarnings("unchecked")