Stop using deprecated methods, ufField
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 7 Mar 2023 03:01:21 +0000 (16:01 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 7 Mar 2023 03:01:21 +0000 (16:01 +1300)
CRM/Admin/Form/Job.php
CRM/Core/BAO/Domain.php
CRM/Core/BAO/OpenID.php
CRM/Core/BAO/UFField.php
CRM/Core/BAO/UFGroup.php
CRM/Core/BAO/WordReplacement.php
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php
api/v3/UFField.php

index 3f11c76ac37769e9c37148ff089515f0129eddc4..d156f3a33dda92f78675a04362a2b148049e57cd 100644 (file)
@@ -189,7 +189,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
     CRM_Utils_System::flushCache();
 
     if ($this->_action & CRM_Core_Action::DELETE) {
-      CRM_Core_BAO_Job::del($this->_id);
+      CRM_Core_BAO_Job::deleteRecord(['id' => $this->_id]);
       CRM_Core_Session::setStatus("", ts('Scheduled Job Deleted.'), "success");
       return;
     }
index a7bb9a9ace2dac6b99fe690f19865ff63f651764..c3642ccbab09b96fd56fc453803a8f3802e00267 100644 (file)
@@ -166,6 +166,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
    * @return CRM_Core_DAO_Domain
    */
   public static function create($params) {
+    CRM_Core_Error::deprecatedFunctionWarning('writeRecord');
     return self::writeRecord($params);
   }
 
index 2e1e1576a192da0b53a587097a10167be19b8535..c82a42dfabefe57cabe9c167cf7508e44473be69 100644 (file)
@@ -126,6 +126,7 @@ ORDER BY
    * @return bool
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     return (bool) self::deleteRecord(['id' => $id]);
   }
 
index ae8a9dd907544f44821c9e3df3c70b62d218eaf5..82cfeb08580e55950d00a90c4528b8d67b30ddc9 100644 (file)
@@ -164,6 +164,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField {
    * @return bool
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     return (bool) self::deleteRecord(['id' => $id]);
   }
 
@@ -319,7 +320,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
     $ufField->find();
     while ($ufField->fetch()) {
       //enable/ disable profile
-      CRM_Core_BAO_UFField::del($ufField->id);
+      CRM_Core_BAO_UFField::deleteRecord(['id' => $ufField->id]);
     }
   }
 
index 44ea26425c1fd16d719f8ff01fee235269e008c0..43c3317b248f715e5b48014d525cec8369e3d744 100644 (file)
@@ -1404,6 +1404,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup implements \Civi\Core\Ho
    * @deprecated
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     return (bool) static::deleteRecord(['id' => $id]);
   }
 
index 0cf4af17a4f0441acd9d5fdba3455fc44175a83c..e3429a12b082bfbf301dc48abce2be43e9067d70 100644 (file)
@@ -65,6 +65,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement implemen
    * @return array
    */
   public static function create($params) {
+    CRM_Core_Error::deprecatedFunctionWarning('writeRecord');
     if (array_key_exists("domain_id", $params) === FALSE) {
       $params["domain_id"] = CRM_Core_Config::domainID();
     }
@@ -85,6 +86,7 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement implemen
    * @return CRM_Core_DAO_WordReplacement
    */
   public static function del($id) {
+    CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
     return static::deleteRecord(['id' => $id]);
   }
 
index 78c5978d652f199a7cf19a5c764cfcd3c27dd121..03d583fa903bd53b877eccb62467d63b170a9e52 100644 (file)
@@ -482,7 +482,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
     if ($this->_action & CRM_Core_Action::DELETE) {
       $fieldValues = ['uf_group_id' => $this->_gid];
       CRM_Utils_Weight::delWeight('CRM_Core_DAO_UFField', $this->_id, $fieldValues);
-      $deleted = CRM_Core_BAO_UFField::del($this->_id);
+      $deleted = CRM_Core_BAO_UFField::deleteRecord(['id' => $this->_id]);
 
       //update group_type every time. CRM-3608
       if ($this->_gid && $deleted) {
index 454a019c5982362aeb4b533e862f0517ea6cb2b6..87814ab22e7c8bb3fe24eb48c487ccce852379ff 100644 (file)
@@ -350,7 +350,7 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
       $title = CRM_Core_BAO_UFGroup::getTitle($this->_id);
-      CRM_Core_BAO_UFGroup::del($this->_id);
+      CRM_Core_BAO_UFGroup::deleteRecord(['id' => $this->_id]);
       CRM_Core_Session::setStatus(ts("Your CiviCRM Profile '%1' has been deleted.", [1 => $title]), ts('Profile Deleted'), 'success');
     }
     elseif ($this->_action & CRM_Core_Action::DISABLE) {
index 0ac6b070d291ba28fffcce2037c47003e04aad5d..526cc49faca429a5ab60ade806c1b23a32bef152 100644 (file)
@@ -77,7 +77,7 @@ function civicrm_api3_uf_field_delete($params) {
     throw new CRM_Core_Exception('Invalid value for field_id.');
   }
 
-  $result = CRM_Core_BAO_UFField::del($fieldId);
+  $result = CRM_Core_BAO_UFField::deleteRecord(['id' => $fieldId]);
 
   $fieldsType = CRM_Core_BAO_UFGroup::calculateGroupType($ufGroupId, TRUE);
   CRM_Core_BAO_UFGroup::updateGroupTypes($ufGroupId, $fieldsType);