svn commit: r629279 - in /ofbiz/trunk/applications: content/src/org/ofbiz/content/survey/SurveyWrapper.java product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r629279 - in /ofbiz/trunk/applications: content/src/org/ofbiz/content/survey/SurveyWrapper.java product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java

sichen
Author: sichen
Date: Tue Feb 19 15:50:35 2008
New Revision: 629279

URL: http://svn.apache.org/viewvc?rev=629279&view=rev
Log:
allow retrieving survey response if there were an errorf

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=629279&r1=629278&r2=629279&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Tue Feb 19 15:50:35 2008
@@ -172,6 +172,8 @@
         Map currentAnswers = null;
         if (responseId != null && canUpdate()) {
             currentAnswers = this.getResponseAnswers(responseId);
+        } else {
+            currentAnswers = this.getResponseAnswers(null);
         }
         
         Map sqaaWithColIdListByMultiRespId = FastMap.newInstance();
@@ -358,9 +360,6 @@
 
     // returns a Map of answers keyed on SurveyQuestion ID from the most current SurveyResponse ID
     public Map getResponseAnswers(String responseId) throws SurveyWrapperException {
-        if (responseId == null) {
-            throw new SurveyWrapperException("Null response ID is not supported at this time");
-        }
 
         Map answerMap = new HashMap();
 

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java?rev=629279&r1=629278&r2=629279&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreSurveyWrapper.java Tue Feb 19 15:50:35 2008
@@ -52,6 +52,11 @@
             throw new IllegalArgumentException("Required parameter productStoreSurveyAppl missing");
         }
         this.setDefaultValues(defaultValues);
+        // sanitize pass-thru, we need to remove hidden fields values that are set
+        // by the survey so they won't be duplicated in additionalFields
+        passThru.remove("surveyId");
+        passThru.remove("partyId");
+        passThru.remove("surveyResponseId");
         this.setPassThru(passThru);
         this.checkParameters();
     }