Advanced search fails to properly search for contribution source
Overview
Try searching for a contribution source from the Advanced search - bet you don't get any results.
Reproduction steps
- Create a contact; add a contribution with a source
findme
- Do an advanced search, specifying a contribution with a source
findme
- no results - expected to find your contact.
Current behaviour
No results.
Reason: the SQL generation generates SQL like this: civicrm_contribution.source IN ("%findme%")
i.e. it's added %
wildcards as if for a LIKE
operator, but then it's used IN
!
Expected behaviour
It should generate SQL like this: civicrm_contribution.source LIKE ("%findme%")
and return the result.
Environment information
- CiviCRM: Master and 5.20.0