CE-1402 Fix (with test) applying field filter behaviors

This commit is contained in:
2024-06-25 10:32:33 -05:00
parent 1eb078d916
commit 7cbd6705e1
2 changed files with 88 additions and 12 deletions

View File

@ -159,6 +159,7 @@ public class ValueBehaviorApplier
}
}
QFilterCriteria criteriaToUse = criteria;
if(field != null)
{
for(FieldBehavior<?> fieldBehavior : CollectionUtils.nonNullCollection(field.getBehaviors()))
@ -175,23 +176,20 @@ public class ValueBehaviorApplier
// call to apply the behavior on the criteria - which will return a //
// new criteria if any values are changed, else the input criteria //
//////////////////////////////////////////////////////////////////////
QFilterCriteria newCriteria = apply(criteria, instance, table, field, filterBehavior);
criteriaToUse = apply(criteriaToUse, instance, table, field, filterBehavior);
if(newCriteria != criteria)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// if the new criteria is not the same as the old criteria, mark that we need to make and return a clone. //
////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(criteriaToUse != criteria)
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// if the new criteria is not the same as the old criteria, mark that we need to make and return a clone. //
////////////////////////////////////////////////////////////////////////////////////////////////////////////
newCriteriaList.add(newCriteria);
needToUseClone = true;
}
else
{
newCriteriaList.add(criteria);
}
}
}
}
newCriteriaList.add(criteriaToUse);
}
/////////////////////////////////////////////////////////////////////////////////////////////////