Skip to content

Commit

Permalink
Merge pull request #25223 from eileenmcnaughton/dep_opt
Browse files Browse the repository at this point in the history
Remove deprecated ids from OptionValue::add
  • Loading branch information
yashodha authored Dec 27, 2022
2 parents 575bb16 + b73af35 commit b31ed08
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions CRM/Core/BAO/OptionValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,13 @@ public static function setIsActive($id, $is_active) {
*
* @param array $params
* Reference array contains the values submitted by the form.
* @param array $ids
* deprecated Reference array contains the id.
*
* @return \CRM_Core_DAO_OptionValue
*
* @throws \CRM_Core_Exception
*/
public static function add(&$params, $ids = []) {
if (!empty($ids['optionValue']) && empty($params['id'])) {
CRM_Core_Error::deprecatedFunctionWarning('$params[\'id\'] should be set, $ids is deprecated');
}
$id = $params['id'] ?? $ids['optionValue'] ?? NULL;
public static function add(&$params) {
$id = $params['id'] ?? NULL;

// Update custom field data to reflect the new value
if ($id && isset($params['value'])) {
Expand Down

0 comments on commit b31ed08

Please sign in to comment.