svn commit: r1805141 - /ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

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

svn commit: r1805141 - /ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

jleroux@apache.org
Author: jleroux
Date: Wed Aug 16 06:34:56 2017
New Revision: 1805141

URL: http://svn.apache.org/viewvc?rev=1805141&view=rev
Log:
Improved: Check there are no white spaces around the name of a form field when
updating a form
(OFBIZ-9306)

Sometimes ago, I lost an hour because of a space at the end of a field's name in
a form. In creation it does not pass (the field lacks) but when updating the
form it passes and it's hard to find from where comes the problem.

Thanks: Michael for review and spotting a possible NPE in my 1st patch

Modified:
    ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java

Modified: ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java?rev=1805141&r1=1805140&r2=1805141&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelFormField.java Wed Aug 16 06:34:56 2017
@@ -381,6 +381,10 @@ public class ModelFormField {
             if (simpleEncoder != null)
                 returnValue = simpleEncoder.encode(returnValue);
         }
+
+        if (returnValue != null) {
+            returnValue = returnValue.trim();
+        }
         return returnValue;
     }