From 81157e2dd8f47e710a07d8c54d2d559c30dca8f5 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 7 Mar 2023 16:01:21 +1300 Subject: [PATCH] Stop using deprecated methods, ufField --- CRM/Admin/Form/Job.php | 2 +- CRM/Core/BAO/Domain.php | 1 + CRM/Core/BAO/OpenID.php | 1 + CRM/Core/BAO/UFField.php | 3 ++- CRM/Core/BAO/UFGroup.php | 1 + CRM/Core/BAO/WordReplacement.php | 2 ++ CRM/UF/Form/Field.php | 2 +- CRM/UF/Form/Group.php | 2 +- api/v3/UFField.php | 2 +- 9 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index 3f11c76ac3..d156f3a33d 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -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; } diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index a7bb9a9ace..c3642ccbab 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -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); } diff --git a/CRM/Core/BAO/OpenID.php b/CRM/Core/BAO/OpenID.php index 2e1e1576a1..c82a42dfab 100644 --- a/CRM/Core/BAO/OpenID.php +++ b/CRM/Core/BAO/OpenID.php @@ -126,6 +126,7 @@ ORDER BY * @return bool */ public static function del($id) { + CRM_Core_Error::deprecatedFunctionWarning('deleteRecord'); return (bool) self::deleteRecord(['id' => $id]); } diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index ae8a9dd907..82cfeb0858 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -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]); } } diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 44ea26425c..43c3317b24 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -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]); } diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index 0cf4af17a4..e3429a12b0 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -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]); } diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index 78c5978d65..03d583fa90 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -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) { diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index 454a019c59..87814ab22e 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -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) { diff --git a/api/v3/UFField.php b/api/v3/UFField.php index 0ac6b070d2..526cc49fac 100644 --- a/api/v3/UFField.php +++ b/api/v3/UFField.php @@ -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); -- 2.25.1