diff --git a/CRM/Contribute/BAO/Query.php b/CRM/Contribute/BAO/Query.php index cf491c624761..40e61e40e873 100644 --- a/CRM/Contribute/BAO/Query.php +++ b/CRM/Contribute/BAO/Query.php @@ -254,7 +254,8 @@ public static function whereClauseSingle(&$values, &$query) { // @todo these are mostly legacy params. Find a better way to deal with them. if (!in_array($name, $fieldNamesNotToStripContributionFrom) ) { - if (!isset($fields[$name])) { + $name = str_replace('contribution_', '', $name); + if (!isset($fields[$qillName]) && isset($fields[str_replace('contribution_', '', $qillName)])) { $qillName = str_replace('contribution_', '', $qillName); } $name = str_replace('contribution_', '', $name);