Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2.3
-
Fix Version/s: 3.3.alpha
-
Component/s: CiviCRM Search
-
Labels:None
Description
I am running into multiple Search Builder problems after an upgrade from 3.0.0 to 3.2.3:
1) When searching for value '0' on Yes/No checkbox fields like Contact "Do Not Mail" or Membership "Status Override", Search Builder is returning a validation error "Please correct the following errors in the form fields below: Please enter the value." I believe values '1' and '0' should be valid values for "Yes" and "No".
2) Search Builder searches on record type Membership and field Membership Type are returning an error of "Database Error Code: Unknown column 'civicrm_membership.membership_type_id' in 'on clause', 1054" (full error below). Problem appears to be that table "civicrm_membership" is not being included as a JOIN in the FROM clause. Adding this would probably fix the problem, "JOIN civicrm_membership ON civicrm_membership.contact_id = contact_a.id ".
3) Search Builder searches on record type Membership and field Membership Status does not return the correct results. It always returns the same records no matter what value is searched for, so a search for "Membership Status = 1" returns the same results for "Membership Status = 2". Many of the returned contacts don't even have a membership so there should be no status and they should not be in the results at all.
The full error from #2:
Database Error Code: Unknown column 'civicrm_membership.membership_type_id' in 'on clause', 1054
Additional Details:
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id LEFT JOIN civicrm_membership_type ON civicrm_membership.membership_type_id = civicrm_membership_type.id
LEFT JOIN civicrm_value_revenue_sharing_11 ON civicrm_value_revenue_sharing_11.entity_id = civicrm_contribution.id WHERE ( ( civicrm_membership_type.name IN ('Individual','Family') AND civicrm_value_revenue_sharing_11.chapter_77 = 'greater oakridge area trail stewards (goats)' ) ) AND (contact_a.is_deleted = 0) [nativecode=1054 ** Unknown column 'civicrm_membership.membership_type_id' in 'on clause']
[type] => DB_Error
[user_info] => SELECT count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id LEFT JOIN civicrm_membership_type ON civicrm_membership.membership_type_id = civicrm_membership_type.id
LEFT JOIN civicrm_value_revenue_sharing_11 ON civicrm_value_revenue_sharing_11.entity_id = civicrm_contribution.id WHERE ( ( civicrm_membership_type.name IN ('Individual','Family') AND civicrm_value_revenue_sharing_11.chapter_77 = 'greater oakridge area trail stewards (goats)' ) ) AND (contact_a.is_deleted = 0) [nativecode=1054 ** Unknown column 'civicrm_membership.membership_type_id' in 'on clause']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id LEFT JOIN civicrm_membership_type ON civicrm_membership.membership_type_id = civicrm_membership_type.id
LEFT JOIN civicrm_value_revenue_sharing_11 ON civicrm_value_revenue_sharing_11.entity_id = civicrm_contribution.id WHERE ( ( civicrm_membership_type.name IN ('Individual','Family') AND civicrm_value_revenue_sharing_11.chapter_77 = 'greater oakridge area trail stewards (goats)' ) ) AND (contact_a.is_deleted = 0) [nativecode=1054 ** Unknown column 'civicrm_membership.membership_type_id' in 'on clause']"]
)