Bug #1343: Use getRawValue instead of getValue in date constraint checkers.
Since the start date depends on the value of the end date and vice versa, a recursive, infinite loop can happen when both dates are going to be validated. FEA: ItEr76S04BugFixing
This commit is contained in:
parent
f43b39f498
commit
b98926549a
1 changed files with 6 additions and 4 deletions
|
|
@ -247,8 +247,9 @@ public class CompanyPlanningController implements Composer {
|
|||
throws WrongValueException {
|
||||
Date finishDate = (Date) value;
|
||||
if ((finishDate != null)
|
||||
&& (filterStartDate.getValue() != null)
|
||||
&& (finishDate.compareTo(filterStartDate.getValue()) < 0)) {
|
||||
&& (filterStartDate.getRawValue() != null)
|
||||
&& (finishDate.compareTo((Date)
|
||||
filterStartDate.getRawValue()) < 0)) {
|
||||
filterFinishDate.setValue(null);
|
||||
throw new WrongValueException(comp,
|
||||
_("must be greater than start date"));
|
||||
|
|
@ -264,8 +265,9 @@ public class CompanyPlanningController implements Composer {
|
|||
throws WrongValueException {
|
||||
Date startDate = (Date) value;
|
||||
if ((startDate != null)
|
||||
&& (filterFinishDate.getValue() != null)
|
||||
&& (startDate.compareTo(filterFinishDate.getValue()) > 0)) {
|
||||
&& (filterFinishDate.getRawValue() != null)
|
||||
&& (startDate.compareTo((Date)
|
||||
filterFinishDate.getRawValue()) > 0)) {
|
||||
filterStartDate.setValue(null);
|
||||
throw new WrongValueException(comp,
|
||||
_("must be lower than finish date"));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue