Fix to some event altering actions not updating the timestamp

pull/375/head
iglocska 2014-12-10 14:08:08 +01:00
parent d8c7acc5f9
commit f14a26444b
5 changed files with 13 additions and 3 deletions

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":35}
{"major":2, "minor":3, "hotfix":36}

View File

@ -1970,6 +1970,8 @@ class AttributesController extends AppController {
'recursive' => -1
));
$event['Event']['published'] = 0;
$date = new DateTime();
$event['Event']['timestamp'] = $date->getTimestamp();
$this->Attribute->Event->save($event);
} else {
$message .= 'Update completed with some errors.';

View File

@ -2863,12 +2863,16 @@ class EventsController extends AppController {
}
}
}
if ($saved > 0 && $event['Event']['published'] == 1) {
if ($saved > 0) {
$event = $this->Event->find('first', array(
'conditions' => array('Event.id' => $id),
'recursive' => -1
));
$event['Event']['published'] = 0;
if ($event['Event']['published'] == 1) {
$event['Event']['published'] = 0;
}
$date = new DateTime();
$event['Event']['timestamp'] = $date->getTimestamp();
$this->Event->save($event);
}
if ($failed > 0) {

View File

@ -160,6 +160,8 @@ class ShadowAttributesController extends AppController {
$event['Event']['proposal_email_lock'] = 0;
}
$event['Event']['published'] = 0;
$date = new DateTime();
$event['Event']['timestamp'] = $date->getTimestamp();
$this->autoRender = false;
if ($this->Event->save($event, array('fieldList' => $fieldList))) {
$this->Log = ClassRegistry::init('Log');

View File

@ -351,6 +351,8 @@ class TemplatesController extends AppController {
'recursive' => -1
));
$event['Event']['published'] = 0;
$date = new DateTime();
$event['Event']['timestamp'] = $date->getTimestamp();
$this->Event->save($event);
if ($fails == 0) $this->Session->setFlash(__('Event populated, ' . $count . ' attributes successfully created.'));
else $this->Session->setFlash(__('Event populated, but ' . $fails . ' attributes could not be saved.'));