From a5eba566f2164b0f3d22cdbb012db9e781c1c25e Mon Sep 17 00:00:00 2001 From: Grzegorz Orczykowski Date: Fri, 13 Dec 2024 00:35:37 +0100 Subject: [PATCH] Use the new query method in PullDataFunctionHandler --- .../entities/javarosa/filter/PullDataFunctionHandler.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entities/src/main/java/org/odk/collect/entities/javarosa/filter/PullDataFunctionHandler.kt b/entities/src/main/java/org/odk/collect/entities/javarosa/filter/PullDataFunctionHandler.kt index 536597f8359..088a19f8fae 100644 --- a/entities/src/main/java/org/odk/collect/entities/javarosa/filter/PullDataFunctionHandler.kt +++ b/entities/src/main/java/org/odk/collect/entities/javarosa/filter/PullDataFunctionHandler.kt @@ -37,7 +37,9 @@ class PullDataFunctionHandler( val filterChild = XPathFuncExpr.toString(args[2]) val filterValue = XPathFuncExpr.toString(args[3]) - instanceAdapter.queryEq(instanceId, filterChild, filterValue).firstOrNull() + val selection = "$filterChild = ?" + val selectionArgs = arrayOf(filterValue) + instanceAdapter.query(instanceId, selection, selectionArgs).firstOrNull() ?.getFirstChild(child)?.value?.value ?: "" } else { fallback?.eval(args, ec) ?: ""