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

When visiting drupal user profile ('/user') get fatal error if sql_mode=only_full_group_by

    Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.29
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      When visiting  drupal user profile ('/user') one gets a fatal error (see below) if sql_mode=only_full_group_by
       
      Database Error Code: Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'nuldemoloc_f927o.Home-address.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by, 1055
      Additional Details: 
      Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -1 [message] => DB Error: unknown error [mode] => 16 [debug_info] => SELECT contact_a.id as contact_id, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.street_address as `Home-street_address`, `Home-address`.city as `Home-city`, `Home-address`.postal_code as `Home-postal_code`, `Home-address`.country_id as `Home-country_id`, `Home-address`.state_province_id as `Home-state_province_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) LEFT JOIN civicrm_location_type `Home-location_type` ON ( ( `Home-address`.location_type_id = `Home-location_type`.id ) ) WHERE ( contact_a.id = '204' ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY `contact_a`.`sort_name` asc, `contact_a`.`id` nativecode=1055 ** Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'nuldemoloc_f927o.Home-address.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [type] => DB_Error [user_info] => SELECT contact_a.id as contact_id, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.street_address as `Home-street_address`, `Home-address`.city as `Home-city`, `Home-address`.postal_code as `Home-postal_code`, `Home-address`.country_id as `Home-country_id`, `Home-address`.state_province_id as `Home-state_province_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) LEFT JOIN civicrm_location_type `Home-location_type` ON ( ( `Home-address`.location_type_id = `Home-location_type`.id ) ) WHERE ( contact_a.id = '204' ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY `contact_a`.`sort_name` asc, `contact_a`.`id` nativecode=1055 ** Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'nuldemoloc_f927o.Home-address.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT contact_a.id as contact_id, contact_a.first_name as `first_name`, contact_a.last_name as `last_name`, `Home-location_type`.id as `Home-location_type_id`, `Home-location_type`.name as `Home-location_type`, `Home-address`.id as `Home-address_id`, `Home-address`.street_address as `Home-street_address`, `Home-address`.city as `Home-city`, `Home-address`.postal_code as `Home-postal_code`, `Home-address`.country_id as `Home-country_id`, `Home-address`.state_province_id as `Home-state_province_id` FROM civicrm_contact contact_a LEFT JOIN civicrm_address `Home-address` ON (`Home-address`.contact_id = contact_a.id AND `Home-address`.location_type_id = 1) LEFT JOIN civicrm_location_type `Home-location_type` ON ( ( `Home-address`.location_type_id = `Home-location_type`.id ) ) WHERE ( contact_a.id = '204' ) AND (contact_a.is_deleted = 0) GROUP BY contact_a.id ORDER BY `contact_a`.`sort_name` asc, `contact_a`.`id` nativecode=1055 ** Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'nuldemoloc_f927o.Home-address.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"] )
       

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alifrumin Alice Frumin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: