Skip to content
Snippets Groups Projects
Commit be3a2df6 authored by jaapjansma's avatar jaapjansma
Browse files

fixed #55 cannot enable online registration when civirules is enabled.

parent 73c7837f
Branches
Tags
No related merge requests found
......@@ -19,7 +19,10 @@ class CRM_Civirules_Utils_CustomDataFromPre {
foreach($params as $key => $value) {
if (stripos($key, 'custom_')===0) {
list($custom_, $fid, $id) = explode("_", $key, 3);
self::setCustomData($objectName, $fid, $value, $id);
if (is_numeric($fid)) {
// The variable $fid should contain a valid ID which should be a numeric value.
self::setCustomData($objectName, $fid, $value, $id);
}
}
}
}
......@@ -27,6 +30,10 @@ class CRM_Civirules_Utils_CustomDataFromPre {
private static function setCustomData($objectName, $field_id, $value, $id) {
$v = $value;
if (!is_numeric($field_id)) {
return; // The parameter $field_id should contain a valid ID which is a numeric value.
}
/**
* Convert value array from
* value_a => 1
......
......@@ -21,7 +21,9 @@ class CRM_Civirules_Utils_CustomField {
* @throws CiviCRM_API3_Exception
*/
public static function isCustomFieldMultiselect($customfield_id) {
//var_dump($customfield_id); exit();
$multi_select_types = self::getMultiselectTypes();
$custom_field = civicrm_api3('CustomField', 'getsingle', array('id' => $customfield_id));
if (in_array($custom_field['html_type'], $multi_select_types)) {
return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment