Skip to content

Commit

Permalink
Don't let optiongroup check crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jul 27, 2019
1 parent a6c9f40 commit 8f352cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Utils/Check/Component/OptionGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ public function checkOptionGroupValues() {
$values = CRM_Core_BAO_OptionValue::getOptionValuesArray($optionGroup['id']);
if (count($values) > 0) {
foreach ($values as $value) {
$validate = CRM_Utils_Type::validate($value['value'], $optionGroup['data_type'], FALSE);
if (is_null($validate)) {
try {
CRM_Utils_Type::validate($value['value'], $optionGroup['data_type'], FALSE, '', TRUE);
}
catch (Exception $e) {
$problemValues[] = [
'group_name' => $optionGroup['title'],
'value_name' => $value['label'],
Expand Down

0 comments on commit 8f352cb

Please sign in to comment.