Deleting tags fixed

- now it correctly deletes tags
- also deletes all EventTags
pull/219/merge
iglocska 2014-02-19 17:38:31 +01:00
parent 5796320e84
commit 914687142e
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,8 @@ class TagsController extends AppController {
if (!$this->Tag->exists()) {
throw new NotFoundException('Invalid tag');
}
if ($this->Attribute->delete()) {
if ($this->Tag->delete()) {
$this->Tag->EventTag->deleteAll(array('EventTag.tag_id' => $id));
$this->Session->setFlash(__('Attribute deleted'));
} else {
$this->Session->setFlash(__('Attribute was not deleted'));