*
*/
public static function flush($name = 'cache') {
- if (isset(self::$name)) {
+ if (isset(self::$$name)) {
self::$$name = NULL;
}
+ if ($name == 'cache') {
+ CRM_Core_OptionGroup::flushAll();
+ }
}
/**
if (isset($options[$value])) {
return;
}
- // Generate error msg before overwriting the value
- $errorMsg = "'$value' is not a valid option for field $fieldName";
// Case-insensitive matching
- $value = strtolower($value);
+ $newValue = strtolower($value);
$options = array_map("strtolower", $options);
- $value = array_search($value, $options);
- if ($value === FALSE) {
- throw new API_Exception($errorMsg, 2001, array('error_field' => $fieldName));
+ $newValue = array_search($newValue, $options);
+ if ($newValue === FALSE) {
+ throw new API_Exception("'$value' is not a valid option for field $fieldName", 2001, array('error_field' => $fieldName));
}
+ $value = $newValue;
}
/**
);
}
- require_once 'CRM/Core/DAO/LocationType.php';
$locationType = new CRM_Core_DAO_LocationType();
$locationType->copyValues($params);
$locationType->save();
}
$customGroup = $this->CustomGroupCreate($entity, $function);
$customField = $this->customFieldCreate($customGroup['id'], $function);
- CRM_Core_PseudoConstant::flush('customGroup');
+ CRM_Core_PseudoConstant::flush();
return array('custom_group_id' => $customGroup['id'], 'custom_field_id' => $customField['id']);
}
);
$this->organizationSponsor = $this->organizationCreate($params);
//refresh php cached variables
- CRM_Core_PseudoConstant::flush('customGroup');
+ CRM_Core_PseudoConstant::flush();
CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndividualField['id'], True);
CRM_Core_BAO_CustomField::getTableColumnGroup($this->IndiStudentField['id'], True);
}