Author: jleroux Date: Sat May 19 06:53:58 2012 New Revision: 1340357 URL: http://svn.apache.org/viewvc?rev=1340357&view=rev Log: 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/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java?rev=1340357&r1=1340356&r2=1340357&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormWrapper.java Sat May 19 06:53:58 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")

