This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new d83b046758 Fixed: Fix condition date when more than two fields are
present (#2093)
d83b046758 is described below
commit d83b046758d862a3b21e0068876e322924fc2a30
Author: Nicolas Malin <[email protected]>
AuthorDate: Mon Sep 28 09:30:20 2026 +0200
Fixed: Fix condition date when more than two fields are present (#2093)
If you create a condition-date with multiple field like that :
<condition-date from-field="myDate">
<date-field field-name="fromDate">
<date-field field-name="thruDate">
<date-field field-name="otherFromDate">
<date-field field-name="otherThruDate">
</condition-date>
Fields otherFromDate and otherThruDate are ignored.
Just fix the loop iterates through date fields
---
.../src/main/java/org/apache/ofbiz/entity/finder/EntityFinderUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/EntityFinderUtil.java
b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/EntityFinderUtil.java
index 5ece4f7638..e3c729b9d5 100644
---
a/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/EntityFinderUtil.java
+++
b/framework/entity/src/main/java/org/apache/ofbiz/entity/finder/EntityFinderUtil.java
@@ -408,7 +408,7 @@ public final class EntityFinderUtil {
dateFieldValue = UtilDateTime.nowTimestamp();
}
List<EntityCondition> conditionDates = UtilMisc.toList();
- for (int i = 0; i < compareDateFields.size() / 2; i++) {
+ for (int i = 0; i < compareDateFields.size(); i = i + 2) {
String fromDateField =
compareDateFields.get(i).expandString(context);
String thruDateField = compareDateFields.get(i +
1).expandString(context);
if (dateFieldFromEntity != null) {