From f4b9c202d601902fe065afe59d7e73b15da76a39 Mon Sep 17 00:00:00 2001 From: Kaushal Shriwas Date: Sat, 21 Mar 2026 15:37:52 +0530 Subject: [PATCH] fix(filter): parse JSON-encoded values in FilterTuple before comma split --- frappe/types/filter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/types/filter.py b/frappe/types/filter.py index acf9369322..5f3811fd6c 100644 --- a/frappe/types/filter.py +++ b/frappe/types/filter.py @@ -1,3 +1,4 @@ +import json import textwrap from collections import defaultdict from collections.abc import Generator, Iterable, Mapping, Sequence @@ -110,7 +111,11 @@ class FilterTuple(_FilterTuple): # soundness if operator in ("in", "not in") and isinstance(value, str): - value = value.split(",") + try: + parsed = json.loads(value) + value = parsed if isinstance(parsed, list) else [parsed] + except ValueError: + value = value.split(",") _value: Value if isinstance(value, _InputValue):