Skip to content

Commit

Permalink
Merge pull request #25747 from eileenmcnaughton/c2
Browse files Browse the repository at this point in the history
Stop using deprecated methods, `ufField::del`
  • Loading branch information
colemanw authored Mar 7, 2023
2 parents 24ed557 + 81157e2 commit 9b0bb0f
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CRM/Admin/Form/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function postProcess() {
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;
}
Expand Down
1 change: 1 addition & 0 deletions CRM/Core/BAO/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public static function edit($params, $id): CRM_Core_DAO_Domain {
* @return CRM_Core_DAO_Domain
*/
public static function create($params) {
CRM_Core_Error::deprecatedFunctionWarning('writeRecord');
return self::writeRecord($params);
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Core/BAO/OpenID.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public static function allOpenIDs($id, $updateBlankLocInfo = FALSE) {
* @return bool
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) self::deleteRecord(['id' => $id]);
}

Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/UFField.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public static function setIsActive($id, $is_active) {
* @return bool
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) self::deleteRecord(['id' => $id]);
}

Expand Down Expand Up @@ -319,7 +320,7 @@ public static function delUFField($customFieldId) {
$ufField->find();
while ($ufField->fetch()) {
//enable/ disable profile
CRM_Core_BAO_UFField::del($ufField->id);
CRM_Core_BAO_UFField::deleteRecord(['id' => $ufField->id]);
}
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ public static function usedByModule($id) {
* @deprecated
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) static::deleteRecord(['id' => $id]);
}

Expand Down
2 changes: 2 additions & 0 deletions CRM/Core/BAO/WordReplacement.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static function edit(&$params, &$id) {
* @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();
}
Expand All @@ -85,6 +86,7 @@ public static function create($params) {
* @return CRM_Core_DAO_WordReplacement
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return static::deleteRecord(['id' => $id]);
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/UF/Form/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public function postProcess() {
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) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/UF/Form/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public static function formRule($fields, $files, $self) {
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) {
Expand Down
2 changes: 1 addition & 1 deletion api/v3/UFField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b0bb0f

Please sign in to comment.