Fix to clone a possibleValueSource filter before calling interpret values... added warning to the javadoc on that method - how to make better?

This commit is contained in:
2023-03-15 11:49:40 -05:00
parent 54d3e4a6c8
commit 7ca9ecbcec
2 changed files with 7 additions and 2 deletions

View File

@ -372,6 +372,10 @@ public class QQueryFilter implements Serializable, Cloneable
/******************************************************************************* /*******************************************************************************
** Replace any criteria values that look like ${input.XXX} with the value of XXX ** Replace any criteria values that look like ${input.XXX} with the value of XXX
** from the supplied inputValues map. ** from the supplied inputValues map.
**
** Note - it may be very important that you call this method on a clone of a
** QQueryFilter - e.g., if it's one that defined in metaData, and that we don't
** want to be (permanently) changed!!
*******************************************************************************/ *******************************************************************************/
public void interpretValues(Map<String, Serializable> inputValues) public void interpretValues(Map<String, Serializable> inputValues)
{ {

View File

@ -1332,8 +1332,9 @@ public class QJavalinImplementation
if(field.getPossibleValueSourceFilter() != null) if(field.getPossibleValueSourceFilter() != null)
{ {
field.getPossibleValueSourceFilter().interpretValues(values); QQueryFilter filter = field.getPossibleValueSourceFilter().clone();
input.setDefaultQueryFilter(field.getPossibleValueSourceFilter()); filter.interpretValues(values);
input.setDefaultQueryFilter(filter);
} }
if(StringUtils.hasContent(ids)) if(StringUtils.hasContent(ids))