Hi David,
The idea behind this fix is to be able to "unexpire" a value. If you expire a value by setting a past date to thruDate and latter
want to "unexpire" it by blanking the thruDate field it was not working. Maybe blanking is not the right way to do it ?
You are right that I'm not the original writer of this fix, but it was tested
seriously.
Jacques
From: "David E Jones" <[EMAIL PROTECTED]>
Jacques,
Could you be more specific about what you are trying to fix here? What was the
problem you ran into, and how does this fix it?
I don't know that this is the case, but it appears that you did not try to understand the code before changing it. The point of
the was originally to not change a field when no parameter was passed in for it, which is what it means when the parameter is
null.
Only when the parameter IS passed in and the parameter is a zero length (empty) string should the corresponding field in the
database be cleared.
-David
On Jun 27, 2008, at 2:32 AM, [EMAIL PROTECTED] wrote:
Author: jleroux
Date: Fri Jun 27 01:32:16 2008
New Revision: 672187
URL: http://svn.apache.org/viewvc?rev=672187&view=rev
Log:
Fix a bug when emptying a field (blanking it)
Modified:
ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/ GenericWebEvent.java
Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/
GenericWebEvent.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java?rev=672187&r1=672186&r2=672187&view=diff
= = = = = = = =
======================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/ GenericWebEvent.java
(original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/ GenericWebEvent.java
Fri Jun 27 01:32:16 2008
@@ -180,7 +180,11 @@
}
String fval = request.getParameter(field.getName());
- if (fval != null && fval.length() > 0) {
+ if (fval != null && fval.length() <= 0) {
+ fval = null;
+ }
+ if (fval == null || fval.length() > 0) {
+
try {
findByEntity.setString(field.getName(), fval);
} catch (Exception e) {