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

Activity Report fails if filtering on any contact

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.1
    • Fix Version/s: 4.4.4
    • Component/s: None
    • Labels:
      None

      Description

      I upgraded a copy of our 4.2.7 to 4.4.1, which seemed to work smoothly.

      However, the Activity Report fails if any of the filters for contacts is used. This includes Source, Assignee and Target Contacts Names as well as the "Limit to Current User".

      This also fails on the demo-installation (for Joomla at least).

      This is the backtrace:

      backTrace

      #0 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Error.php(149): CRM_Core_Error::backtrace()
      #1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
      #2 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
      #3 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #4 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #5 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...", "DB_Error", TRUE)
      #6 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'civicrm_contact_source.sort_name' in 'where clause'")
      #7 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
      #8 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #9 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #10 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #11 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(158): DB_DataObject->query("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #12 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php(905): CRM_Core_DAO->query("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...", TRUE)
      #13 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Report/Form/Activity.php(533): CRM_Core_DAO::executeQuery("CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COL...")
      #14 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(261): CRM_Report_Form_Activity->postProcess()
      #15 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Submit.php(73): CRM_Core_Form->mainProcess()
      #16 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Submit->perform(Object(CRM_Report_Form_Activity), "submit")
      #17 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Report_Form_Activity), "submit")
      #18 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(345): HTML_QuickForm_Page->handle("submit")
      #19 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()
      #20 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Report/Page/Instance.php(103): CRM_Utils_Wrapper->run("CRM_Report_Form_Activity", NULL, NULL)
      #21 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(323): CRM_Report_Page_Instance->run((Array:4), NULL)
      #22 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(72): CRM_Core_Invoke::runItem((Array:14))
      #23 /Library/WebServer/Documents/events/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
      #24 /Library/WebServer/Documents/events/administrator/components/com_civicrm/admin.civicrm.php(116): CRM_Core_Invoke::invoke((Array:4))
      #25 /Library/WebServer/Documents/events/administrator/components/com_civicrm/admin.civicrm.php(40): civicrm_invoke()
      #26 /Library/WebServer/Documents/events/libraries/joomla/application/component/helper.php(383): require_once("/Library/WebServer/Documents/events/administrator/components/com_civicrm/admi...")
      #27 /Library/WebServer/Documents/events/libraries/joomla/application/component/helper.php(351): JComponentHelper::executeComponent("/Library/WebServer/Documents/events/administrator/components/com_civicrm/admi...")
      #28 /Library/WebServer/Documents/events/administrator/includes/application.php(153): JComponentHelper::renderComponent("com_civicrm")
      #29 /Library/WebServer/Documents/events/administrator/index.php(46): JAdministrator->dispatch()
      #30

      {main}

      Sorry but we are not able to provide this at the moment.
      DB Error: no such field
      Totalt antal rader
      Databasfelkod: Unknown column 'civicrm_contact_source.sort_name' in 'where clause', 1054
      Ytterligare detaljer:
      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -19
      [message] => DB Error: no such field
      [mode] => 16
      [debug_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
      SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id
      FROM civicrm_activity activity_civireport
      INNER JOIN civicrm_activity_contact activity_contact_civireport
      ON activity_civireport.id = activity_contact_civireport.activity_id AND
      activity_contact_civireport.record_type_id = 3
      INNER JOIN civicrm_contact civicrm_contact_target
      ON activity_contact_civireport.contact_id = civicrm_contact_target.id

      LEFT JOIN civicrm_address address_civireport
      ON (civicrm_contact_target.id =
      address_civireport.contact_id) AND
      address_civireport.is_primary = 1
      WHERE activity_civireport.is_test = 0 AND
      activity_civireport.is_deleted = 0 AND
      activity_civireport.is_current_revision = 1 AND ( civicrm_contact_source.sort_name = 'thomas' ) AND ( activity_civireport.subject LIKE '%thomas%' ) AND ( activity_civireport.activity_type_id IN (19) ) AND ( activity_civireport.status_id IN (1) ) AND ( address_civireport.country_id IN (1001) ) [nativecode=1054 ** Unknown column 'civicrm_contact_source.sort_name' in 'where clause']
      [type] => DB_Error
      [user_info] => CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
      SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id
      FROM civicrm_activity activity_civireport
      INNER JOIN civicrm_activity_contact activity_contact_civireport
      ON activity_civireport.id = activity_contact_civireport.activity_id AND
      activity_contact_civireport.record_type_id = 3
      INNER JOIN civicrm_contact civicrm_contact_target
      ON activity_contact_civireport.contact_id = civicrm_contact_target.id

      LEFT JOIN civicrm_address address_civireport
      ON (civicrm_contact_target.id =
      address_civireport.contact_id) AND
      address_civireport.is_primary = 1
      WHERE activity_civireport.is_test = 0 AND
      activity_civireport.is_deleted = 0 AND
      activity_civireport.is_current_revision = 1 AND ( civicrm_contact_source.sort_name = 'thomas' ) AND ( activity_civireport.subject LIKE '%thomas%' ) AND ( activity_civireport.activity_type_id IN (19) ) AND ( activity_civireport.status_id IN (1) ) AND ( address_civireport.country_id IN (1001) ) [nativecode=1054 ** Unknown column 'civicrm_contact_source.sort_name' in 'where clause']
      [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TEMPORARY TABLE civireport_activity_temp_target CHARACTER SET utf8 COLLATE utf8_unicode_ci AS
      SELECT civicrm_contact_target.sort_name as civicrm_contact_contact_target, civicrm_contact_target.id as civicrm_contact_contact_target_id, activity_civireport.id as civicrm_activity_id, activity_civireport.source_record_id as civicrm_activity_source_record_id, activity_civireport.activity_type_id as civicrm_activity_activity_type_id, activity_civireport.subject as civicrm_activity_activity_subject, activity_civireport.activity_date_time as civicrm_activity_activity_date_time, activity_civireport.status_id as civicrm_activity_status_id
      FROM civicrm_activity activity_civireport
      INNER JOIN civicrm_activity_contact activity_contact_civireport
      ON activity_civireport.id = activity_contact_civireport.activity_id AND
      activity_contact_civireport.record_type_id = 3
      INNER JOIN civicrm_contact civicrm_contact_target
      ON activity_contact_civireport.contact_id = civicrm_contact_target.id

      LEFT JOIN civicrm_address address_civireport
      ON (civicrm_contact_target.id =
      address_civireport.contact_id) AND
      address_civireport.is_primary = 1
      WHERE activity_civireport.is_test = 0 AND
      activity_civireport.is_deleted = 0 AND
      activity_civireport.is_current_revision = 1 AND ( civicrm_contact_source.sort_name = 'thomas' ) AND ( activity_civireport.subject LIKE '%thomas%' ) AND ( activity_civireport.activity_type_id IN (19) ) AND ( activity_civireport.status_id IN (1) ) AND ( address_civireport.country_id IN (1001) ) [nativecode=1054 ** Unknown column 'civicrm_contact_source.sort_name' in 'where clause']"]
      )
      Återvänd till startsidan.

        Attachments

        1. AllContacts.png
          31 kB
          Monish Deb
        2. civicrm-4.1-dashboard-my-activities.png
          27 kB
          Thomas Nilefalk
        3. civicrm-4.4.3-my-activites-no-sourcecontact-displayed.png
          48 kB
          Thomas Nilefalk
        4. civicrm-4.4.3-my-activities.png
          56 kB
          Thomas Nilefalk
        5. CiviCRM Activit Report.m4v
          2.12 MB
          Thomas Nilefalk
        6. Screen Shot 2013-11-25 at 3.10.53 PM.PNG
          102 kB
          David Greenberg
        7. Screen Shot 2013-11-25 at 3.12.31 PM.PNG
          98 kB
          David Greenberg
        8. WithoutSourceContact.png
          37 kB
          Monish Deb

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              thoni56 Thomas Nilefalk
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: