From 9b2c3a84ab26608f2f293f876109c9101fabc052 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 28 Feb 2023 20:32:09 -0500 Subject: [PATCH] Remove deprecated use of $ids --- CRM/Core/BAO/OptionGroup.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/CRM/Core/BAO/OptionGroup.php b/CRM/Core/BAO/OptionGroup.php index 09e2169423..c7de6d7eea 100644 --- a/CRM/Core/BAO/OptionGroup.php +++ b/CRM/Core/BAO/OptionGroup.php @@ -52,18 +52,14 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup implements \Civi * Add the Option Group. * * @param array $params - * Reference array contains the values submitted by the form. - * @param array $ids - * Reference array contains the id. * * @deprecated * @return CRM_Core_DAO_OptionGroup */ - public static function add(&$params, $ids = []) { - if (empty($params['id']) && !empty($ids['optionGroup'])) { - CRM_Core_Error::deprecatedFunctionWarning('no $ids array'); - $params['id'] = $ids['optionGroup']; - } + public static function add($params) { + // This is very similar to CRM_Core_DAO::makeNameFromLabel which would be + // called automatically via `self::writeRecord()` + // TODO: Check if the differences matter, then deprecate this function and switch to writeRecord. if (empty($params['name']) && empty($params['id'])) { $params['name'] = CRM_Utils_String::titleToVar(strtolower($params['title'])); } -- 2.25.1