From 633430e6b76bf1b4506c33df1083d38950208cf0 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 15 Sep 2014 16:29:02 +1200 Subject: [PATCH] fix event handling of is_template (now cannot be NULL) --- api/v3/Event.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/api/v3/Event.php b/api/v3/Event.php index 0566c134f0..5bf0981b3b 100644 --- a/api/v3/Event.php +++ b/api/v3/Event.php @@ -79,6 +79,7 @@ function _civicrm_api3_event_create_spec(&$params) { $params['title']['api.required'] = 1; $params['is_active']['api.default'] = 1; $params['financial_type_id']['api.aliases'] = array('contribution_type_id'); + $params['is_template']['api.default'] = 0; } /** @@ -127,13 +128,6 @@ function civicrm_api3_event_get($params) { $eventDAO = new CRM_Event_BAO_Event(); _civicrm_api3_dao_set_filter($eventDAO, $params, TRUE, 'Event'); - if (!empty($params['is_template'])) { - $eventDAO->whereAdd( '( is_template = 1 )' ); - } - elseif(empty($eventDAO->id)){ - $eventDAO->whereAdd('( is_template IS NULL ) OR ( is_template = 0 )'); - } - if (!empty($params['isCurrent'])) { $eventDAO->whereAdd('(start_date >= CURDATE() || end_date >= CURDATE())'); } -- 2.25.1