CRM-19165 Use permission sensitive function to create strip-numeric function
authoreileen <emcnaughton@wikimedia.org>
Tue, 2 Aug 2016 02:42:36 +0000 (14:42 +1200)
committereileen <emcnaughton@wikimedia.org>
Tue, 2 Aug 2016 02:57:43 +0000 (14:57 +1200)
CRM/Contact/BAO/Contact.php

index 4711af7451aab8f5e4d8bc240dc55a2621d3ee6c..858ad46a4ea2abeeb1c3fe4680157750823344ff 100644 (file)
@@ -3280,8 +3280,9 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
     // Update phone table to populate phone_numeric field
     if (!$tableName || $tableName == 'civicrm_phone') {
       // Define stored sql function needed for phones
-      CRM_Core_DAO::executeQuery(self::DROP_STRIP_FUNCTION_43);
-      CRM_Core_DAO::executeQuery(self::CREATE_STRIP_FUNCTION_43);
+      $sqlTriggers = Civi::service('sql_triggers');
+      $sqlTriggers->enqueueQuery(self::DROP_STRIP_FUNCTION_43);
+      $sqlTriggers->enqueueQuery(self::CREATE_STRIP_FUNCTION_43);
       $info[] = array(
         'table' => array('civicrm_phone'),
         'when' => 'BEFORE',