SearchBuilder: contact search for tags with child-tags broken when using '=' operator
Overview
Searching for contact tags using the '=' operator is broken, if they have child tags: you get an SQL error. This problem was probably introduced with #1795 (closed).
Reproduction steps
- Create tag A
- Create tag B as a child of tag A
- Go to the search builder
- Search for contacts, tag(s), '=', tag A (see screenshot)
- Got an error "Fatal error: DB error".
Current behaviour
DB Error with a something like
civicrm_entity_tag-60659ba2e61bf`.tag_id IN ( )
in the generated SQL.
Expected behaviour
Search should work :)
Environment information
Could reproduce this on dmaster, version 5.37.alpha1
. Also reproduces on 5.35.1
.
Comments
I think I know the culprit and am working on a patch.
Edited by Björn Endres