Commit bc44bce2 authored by jaapjansma's avatar jaapjansma

fixed notices

parent 49d39163
......@@ -220,6 +220,8 @@
// Validate the parameters.
foreach($formProcessor['inputs'] as $input) {
$inputType = $input['type'];
unset($input['type']);
$objInput = new \CRM_FormProcessor_BAO_FormProcessorInput();
$objInput->copyValues($input);
......@@ -231,7 +233,7 @@
if ($input['is_required'] && !isset($params[$input['name']])) {
throw new \API_Exception('Parameter '.$input['name'].' is required');
}
if (isset($params[$input['name']]) && !empty($params[$input['name']]) && !$input['type']->validateValue($params[$input['name']], $params)) {
if (isset($params[$input['name']]) && !empty($params[$input['name']]) && !$inputType->validateValue($params[$input['name']], $params)) {
throw new \API_Exception('Parameter '.$input['name'].' is invalid');
}
// Check the validations on the input.
......@@ -243,7 +245,7 @@
}
}
$dataBag->setInputData($objInput, $input['type']->normalizeValue($params[$objInput->name]));
$dataBag->setInputData($objInput, $inputType->normalizeValue($params[$objInput->name]));
}
// Execute the actions
......@@ -272,7 +274,7 @@
$actionClass->setCondition($condition);
// Check whether the action should be delayed
if ($action['delay']) {
if (isset($action['delay']) && $action['delay']) {
$delayClass = $delayedActionFactory->getHandlerByName($action['delay']);
$configuration = $delayClass->getDefaultConfiguration();
if (is_array($action['delay_configuration'])) {
......
......@@ -119,6 +119,8 @@ class FormProcessorDefaults extends FormProcessor implements API_ProviderInterfa
// Validate the parameters.
foreach ($formProcessor['default_data_inputs'] as $input) {
$inputType = $input['type'];
unset($input['type']);
$objInput = new \CRM_FormProcessor_BAO_FormProcessorDefaultDataInput();
$objInput->copyValues($input);
......@@ -130,7 +132,7 @@ class FormProcessorDefaults extends FormProcessor implements API_ProviderInterfa
if ($input['is_required'] && !isset($params[$input['name']])) {
throw new \API_Exception('Parameter ' . $input['name'] . ' is required');
}
if (isset($params[$input['name']]) && !empty($params[$input['name']]) && !$input['type']->validateValue($params[$input['name']], $params)) {
if (isset($params[$input['name']]) && !empty($params[$input['name']]) && !$inputType->validateValue($params[$input['name']], $params)) {
throw new \API_Exception('Parameter ' . $input['name'] . ' is invalid');
}
// Check the validations on the input.
......@@ -142,7 +144,7 @@ class FormProcessorDefaults extends FormProcessor implements API_ProviderInterfa
}
}
$dataBag->setInputData($objInput, $input['type']->normalizeValue($params[$objInput->name]));
$dataBag->setInputData($objInput, $inputType->normalizeValue($params[$objInput->name]));
}
// Execute the actions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment