Small correction to delete attribute after uuid change.
pull/61/head
noud 2012-09-06 08:38:15 +02:00
parent 6b52841521
commit db222f8e5e
1 changed files with 8 additions and 3 deletions

View File

@ -411,14 +411,19 @@ class AttributesController extends AppController {
throw new NotFoundException(__('Invalid attribute'));
}
if ('true' == Configure::read('CyDefSIG.sync')) {
// find the uuid
$result = $this->Attribute->findById($id);
$uuid = $result['Attribute']['uuid'];
}
// attachment will be deleted with the beforeDelete() function in the Model
if ($this->Attribute->delete()) {
// delete the attribute from remote servers
if ('true' == Configure::read('CyDefSIG.sync')) {
// find the uuid
$result = $this->Attribute->find('first', array('conditions' => array('Attribute.id' => $id)));
$this->_deleteAttributeFromServers($result['Attribute']['uuid']);
$this->_deleteAttributeFromServers($uuid);
}
$this->Session->setFlash(__('Attribute deleted'));