Some fixes to indeces not set

- Affecting Event creation, attribute deletion remotely and logging of
  event deletion
pull/64/merge
Andras Iklody 2013-04-17 15:40:01 +02:00
parent a6e2e8cfac
commit ada0fd2bfb
3 changed files with 2 additions and 10 deletions

View File

@ -691,12 +691,6 @@ class AttributesController extends AppController {
* TODO move this to a component(?)
*/
private function __deleteAttributeFromServers($uuid) {
// TODO private and delete .. bring up ..
//$existingAttribute = $this->Attribute->findByUuid($this->request->data['Attribute']['uuid']);
if (true == $result['Attribute']['private']) { // never upload private attributes
// return "Attribute is private and non exportable";
return;
}
// get a list of the servers
$this->loadModel('Server');

View File

@ -310,7 +310,6 @@ class EventsController extends AppController {
*/
public function add() {
if ($this->request->is('post')) {
$savedId = $this->request->data['Event']['id'];
// TODO or massageData here
if ($this->_isRest()) {
// Distribution, reporter for the events pushed will be the owner of the authentication key
@ -352,7 +351,7 @@ class EventsController extends AppController {
} else {
if ($this->_isRest()) { // TODO return error if REST
// REST users want to see the failed event
$this->view($savedId);
$this->view($this->Event->getId());
$this->render('view');
} else {
$this->Session->setFlash(__('The event could not be saved. Please, try again.'), 'default', array(), 'error');
@ -613,7 +612,6 @@ class EventsController extends AppController {
}
}
$this->request->data = $this->Event->massageData($this->request->data);
if ($this->Event->save($this->request->data, true, $fieldList)) {
$this->Session->setFlash(__('The event has been saved'));
$this->redirect(array('action' => 'view', $id));

View File

@ -187,7 +187,7 @@ class SysLogLogableBehavior extends LogableBehavior {
App::build(array('Controller' => array(APP . DS . 'Controller'), 'EventsController'));
$this->Events = new EventsController();
$this->Events->constructClasses();
$title = 'Event ('. $Model->data[$Model->alias]['id'].'): '.$this->Events->getName($Model->data[$Model->alias]['id']);
$title = 'Event ('. $Model->data[$Model->alias]['id'] .'): '. $Model->data[$Model->alias]['info'];
$logData['Log']['title'] = $title;
break;
case "Attribute":