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

Fixed issue with a broken filter

parent f2dc84fb
No related branches found
No related tags found
No related merge requests found
......@@ -203,22 +203,18 @@ class CRM_Dataprocessor_BAO_DataProcessor extends CRM_Dataprocessor_DAO_DataProc
* @throws \Exception when no data processor is found.
*/
public static function getDataProcessorById($id) {
static $processors = array();
if (!isset($processors[$id])) {
$sql = "
SELECT civicrm_data_processor.*
FROM civicrm_data_processor
WHERE id = %1
";
$params[1] = [$id, 'Integer'];
$dao = CRM_Dataprocessor_BAO_DataProcessor::executeQuery($sql, $params, TRUE, 'CRM_Dataprocessor_BAO_DataProcessor');
if ($dao->N != 1) {
throw new \Exception('Could not find Data Processor');
}
$dao->fetch();
$processors[$id] = $dao->getDataProcessor();
$sql = "
SELECT civicrm_data_processor.*
FROM civicrm_data_processor
WHERE id = %1
";
$params[1] = [$id, 'Integer'];
$dao = CRM_Dataprocessor_BAO_DataProcessor::executeQuery($sql, $params, TRUE, 'CRM_Dataprocessor_BAO_DataProcessor');
if ($dao->N != 1) {
throw new \Exception('Could not find Data Processor');
}
return $processors[$id];
$dao->fetch();
return $dao->getDataProcessor();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment