From bb33fc63f8e8894b2e4234675bc4dc68c3432bdc Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 23 Nov 2022 15:22:45 -0500 Subject: [PATCH] APIv3 - Don't use deprecated del() methods This follows the same pattern as the create action - to only use BAO methods if they are not @deprecated. Note that APIv4 already does this in the DAODeleteAction class. --- api/v3/utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index 648defa7e1..37fb251ee5 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1395,7 +1395,7 @@ function _civicrm_api3_basic_create_fallback($bao_name, $params) { function _civicrm_api3_basic_delete($bao_name, &$params) { civicrm_api3_verify_mandatory($params, NULL, ['id']); _civicrm_api3_check_edit_permissions($bao_name, ['id' => $params['id']]); - if (method_exists($bao_name, 'del')) { + if (method_exists($bao_name, 'del') && !\Civi\Api4\Utils\ReflectionUtils::isMethodDeprecated($bao_name, 'del')) { $args = [&$params['id']]; $dao = new $bao_name(); $dao->id = $params['id']; -- 2.25.1