From 85b7baa13178a838fe9fae94405c99fe7d2c669c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 19 Dec 2017 18:09:41 -0500 Subject: [PATCH] Fix event Groups associations --- web/api/app/Controller/EventsController.php | 7 ------- web/api/app/Model/Event.php | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/web/api/app/Controller/EventsController.php b/web/api/app/Controller/EventsController.php index 446285729..f43672737 100644 --- a/web/api/app/Controller/EventsController.php +++ b/web/api/app/Controller/EventsController.php @@ -102,10 +102,6 @@ class EventsController extends AppController { */ public function view($id = null) { $this->loadModel('Config'); - $configs = $this->Config->find('list', array( - 'fields' => array('Name', 'Value'), - 'conditions' => array('Name' => array('ZM_DIR_EVENTS')) - )); $this->Event->recursive = 1; if (!$this->Event->exists($id)) { @@ -123,9 +119,6 @@ class EventsController extends AppController { $options = array('conditions' => array(array('Event.' . $this->Event->primaryKey => $id), $mon_options)); $event = $this->Event->find('first', $options); - //$path = $configs['ZM_DIR_EVENTS'].'/'.$this->Image->getEventPath($event).'/'; - //$event['Event']['BasePath'] = $path; - # Get the previous and next events for any monitor $this->Event->id = $id; $event_neighbors = $this->Event->find('neighbors'); diff --git a/web/api/app/Model/Event.php b/web/api/app/Model/Event.php index 3ce1b93bb..dd5cc0531 100644 --- a/web/api/app/Model/Event.php +++ b/web/api/app/Model/Event.php @@ -78,10 +78,10 @@ class Event extends AppModel { 'className' => 'Group', 'joinTable' => 'Groups_Monitors', 'foreignKey' => 'MonitorId', - 'associationForeignKey' => 'GroupId', + 'associationForeignKey' => 'MonitorId', 'unique' => true, 'dependent' => false, - 'conditions' => 'Groups_Monitors.MonitorId=Event.MonitorId', + 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '',