Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14888

historical smart groups with membership status break on upgrade to 4.4

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.5
    • Fix Version/s: 4.4.7
    • Component/s: None
    • Labels:

      Description

      Historical smart groups have whereClauses like

      ( ( LOWER(civicrm_membership_status.name) = 'new' AND contact_a.contact_type IN ('Individual') )

      Where result in fatal errors like

      new is not of the type Integer

      We are trialling handling for this

      @@ -192,9 +193,13 @@ class CRM_Member_BAO_Query {

      case 'membership_status':
      case 'member_status_id':
      + $statusTypes = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label');
      if (!is_array($value)) {
      $status = $value;
      if (!empty($value)) {
      + if(!is_numeric($value))

      { + $value = $status = array_search($value, $statusTypes); + }

      $value = array_flip(explode(",", str_replace(array( '(', ')' ), '', $value)));
      }
      else {
      Stage this hunk [y,n,q,a,d,/,K,j,J,g,s,e,?]? y
      @@ -210,7 +215,7 @@ class CRM_Member_BAO_Query {
      }

      $names = array();

      • $statusTypes = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label');
        +

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eileen Eileen McNaughton
                Reporter:
                eileen Eileen McNaughton
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: