JMAConsulting / biz.jmaconsulting.activitytypeacl

This extension provides the ability to restrict activities on CiviCRM by roles with permissions to various activity types.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Activity Search Error: DB Syntax #25

Closed joseltorres closed 2 years ago

joseltorres commented 2 years ago

Activity search works with extension disabled, but fails as soon as I enable it.


  "message" => "DB Error: syntax error"
  "code" => null
  "exception" => PEAR_Exception {#1152
    #cause: DB_Error {#1187
      +error_message_prefix: ""
      +mode: 16
      +level: 1024
      +code: -2
      +message: "DB Error: syntax error"
      +userinfo: """
        SELECT count( DISTINCT ( civicrm_activity.id ) ) as rowCount  FROM civicrm_contact contact_a   LEFT JOIN civicrm_activity_contact\n
                              ON ( civicrm_activity_contact.contact_id = contact_a.id )  LEFT JOIN civicrm_activity\n
                              ON ( civicrm_activity.id = civicrm_activity_contact.activity_id\n
                              AND civicrm_activity.is_deleted = 0 AND civicrm_activity.is_current_revision = 1 ) INNER JOIN civicrm_contact\n
                              ON ( civicrm_activity_contact.contact_id = civicrm_contact.id and civicrm_contact.is_deleted != 1 )  LEFT JOIN civicrm_activity_contact source_activity\n
                    ON (source_activity.activity_id = civicrm_activity_contact.activity_id\n
                      AND source_activity.record_type_id = 2)\n
                  LEFT JOIN civicrm_contact source_contact ON (source_activity.contact_id = source_contact.id)  WHERE  ( civicrm_activity.activity_type_id IN ("55") AND civicrm_activity.is_test = 0 )  AND  (  ( civicrm_activity.activity_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12,17,19,22,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,54,55,56,57,58,59,60,61,62,63,64,65,66,67) )  )  AND ( 1 ) AND (contact_a.is_deleted = 0) AND (civicrm_activity.activity_type_id Array)     [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array)' at line 8]
        """
Edzelopez commented 2 years ago

@lukeyangjma can you include a fix for this as well in your latest PR?

Edzelopez commented 2 years ago

We've addressed this in the PR here: https://github.com/JMAConsulting/biz.jmaconsulting.activitytypeacl/pull/26 and will include in new release later this week