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

Fix buildACLClause for Activity Reports

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.5
    • Component/s: CiviReport
    • Labels:
      None

      Description

      Fix buildACLClause for Activity Reports

      Create a user that has following permissions :

      1. view my contact
      2. view all activities
      3. access CiviReport

      Try to access activity report, it gives a DB error :

      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.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
      INNER JOIN civicrm_acl_contact_cache aclContactCache_0 ON ( civicrm_contact_source.id = aclContactCache_0.contact_id OR civicrm_contact_source.id IS NULL ) AND aclContactCache_0.user_id = 223 INNER JOIN civicrm_acl_contact_cache aclContactCache_1 ON ( civicrm_contact_target.id = aclContactCache_1.contact_id OR civicrm_contact_target.id IS NULL ) AND aclContactCache_1.user_id = 223 INNER JOIN civicrm_acl_contact_cache aclContactCache_2 ON ( civicrm_contact_assignee.id = aclContactCache_2.contact_id OR civicrm_contact_assignee.id IS NULL ) AND aclContactCache_2.user_id = 223 WHERE activity_civireport.is_test = 0 AND
      activity_civireport.is_deleted = 0 AND
      activity_civireport.is_current_revision = 1 AND ( activity_civireport.activity_type_id IN (90, 94, 91, 88, 92, 93, 95, 89) ) [nativecode=1054 ** Unknown column 'civicrm_contact_source.id' in 'on clause']

        Attachments

          Activity

            People

            • Assignee:
              jitendra.purohit Jitendra Purohit
              Reporter:
              yashodha Yashodha Chaku
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: