fixes bug where event is not unpublished when attribute is edited

pull/61/head
Christophe Vandeplas 2012-05-11 08:33:04 +02:00
parent 395f29dd21
commit 9e7ee3c85b
1 changed files with 5 additions and 0 deletions

View File

@ -315,6 +315,11 @@ class AttributesController extends AppController {
if ($this->Attribute->save($this->request->data, true, $fieldList)) {
$this->Session->setFlash(__('The attribute has been saved'));
// remove the published flag from the event
$this->Event->id = $this->request->data['Attribute']['event_id'];
$this->Event->saveField('published', 0);
$this->redirect(array('controller' => 'events', 'action' => 'view', $event_id));
} else {
$this->Session->setFlash(__('The attribute could not be saved. Please, try again.'));