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

fatal error trying to create a smart group from search build with 'is empty' criteria

    Details

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

      Description

      steps (taken on demo)
      1) create search builder search - use 'gender is empty' as the criteria
      2) attempt to create a smart group from the results

      Database Error Code: Data truncated for column 'operator' at row 1, 1265
      Additional Details:

      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -1
      [message] => DB Error: unknown error
      [mode] => 16
      [debug_info] => INSERT INTO civicrm_mapping_field (mapping_id , name , contact_type , column_number , grouping , operator , value ) VALUES ( 2 , 'gender_id' , 'Individual' , 0 , 1 , 'IS EMPTY' , '' ) [nativecode=1265 ** Data truncated for column 'operator' at row 1]
      [type] => DB_Error
      [user_info] => INSERT INTO civicrm_mapping_field (mapping_id , name , contact_type , column_number , grouping , operator , value ) VALUES ( 2 , 'gender_id' , 'Individual' , 0 , 1 , 'IS EMPTY' , '' ) [nativecode=1265 ** Data truncated for column 'operator' at row 1]
      [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_mapping_field (mapping_id , name , contact_type , column_number , grouping , operator , value ) VALUES ( 2 , 'gender_id' , 'Individual' , 0 , 1 , 'IS EMPTY' , '' ) [nativecode=1265 ** Data truncated for column 'operator' at row 1]"]
      )

      this sql seems to fix

      ALTER TABLE `civicrm_mapping_field`
      CHANGE COLUMN `operator` `operator` ENUM('=','!=','>','<','>=','<=','IN','NOT IN','LIKE','NOT LIKE','IS NULL','IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY', 'REGEX');

      The last 3 are additions

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: