fix(db_query): allow filtering name: None (#32644)

This doesn't make any sense, but ig it might get introduced via indirect
calls, so better to handle this in code explicitly.

closes https://github.com/frappe/frappe/issues/32643
This commit is contained in:
Ankush Menat 2025-05-23 10:02:14 +05:30 committed by GitHub
parent d65f82db19
commit c249e75fe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -878,7 +878,7 @@ from {tables}
fallback = "''"
elif f.fieldname == "name":
value = f.value
value = f.value if f.value is not None else ""
fallback = "''"
elif (

View file

@ -1201,6 +1201,7 @@ class TestDBQuery(IntegrationTestCase):
self.assertIn("''", query)
self.assertNotIn("\\'", query)
self.assertNotIn("ifnull", query)
self.assertFalse(frappe.get_all("DocField", {"name": None}))
def test_ifnull_fallback_types(self):
query = frappe.get_all("DocField", {"fieldname": ("!=", None)}, run=0)