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 ...@@ -203,22 +203,18 @@ class CRM_Dataprocessor_BAO_DataProcessor extends CRM_Dataprocessor_DAO_DataProc
* @throws \Exception when no data processor is found. * @throws \Exception when no data processor is found.
*/ */
public static function getDataProcessorById($id) { public static function getDataProcessorById($id) {
static $processors = array(); $sql = "
if (!isset($processors[$id])) { SELECT civicrm_data_processor.*
$sql = " FROM civicrm_data_processor
SELECT civicrm_data_processor.* WHERE id = %1
FROM civicrm_data_processor ";
WHERE id = %1 $params[1] = [$id, 'Integer'];
"; $dao = CRM_Dataprocessor_BAO_DataProcessor::executeQuery($sql, $params, TRUE, 'CRM_Dataprocessor_BAO_DataProcessor');
$params[1] = [$id, 'Integer']; if ($dao->N != 1) {
$dao = CRM_Dataprocessor_BAO_DataProcessor::executeQuery($sql, $params, TRUE, 'CRM_Dataprocessor_BAO_DataProcessor'); throw new \Exception('Could not find Data Processor');
if ($dao->N != 1) {
throw new \Exception('Could not find Data Processor');
}
$dao->fetch();
$processors[$id] = $dao->getDataProcessor();
} }
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