1, 'data_type' => ['IS NOT NULL' => 1], 'options' => ['limit' => 0], ]); if ($optionGroups['count'] > 0) { foreach ($optionGroups['values'] as $optionGroup) { $values = CRM_Core_BAO_OptionValue::getOptionValuesArray($optionGroup['id']); if (count($values) > 0) { foreach ($values as $value) { try { CRM_Utils_Type::validate($value['value'], $optionGroup['data_type']); } catch (CRM_Core_Exception $e) { $problemValues[] = [ 'group_name' => $optionGroup['title'], 'value_name' => $value['label'], ]; } } } } } if (!empty($problemValues)) { $strings = ''; foreach ($problemValues as $problemValue) { $strings .= ts(' "%1" "%2" ', [ 1 => $problemValue['group_name'], 2 => $problemValue['value_name'], ]); } $messages[] = new CRM_Utils_Check_Message( __FUNCTION__, ts('The Following Option Values contain value fields that do not match the Data Type of the Option Group

') . $strings . ts('
Option GroupOption Value

'), ts('Option Values with problematic Values'), \Psr\Log\LogLevel::NOTICE, 'fa-server' ); } return $messages; } }