Skip to content

Commit

Permalink
Merge pull request #7 from joomlatools/feature/6-delete
Browse files Browse the repository at this point in the history
Fix deletion of tags without relations
  • Loading branch information
ercanozkaya authored Jul 13, 2016
2 parents 8724e56 + 01e1806 commit bfa165d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions model/entity/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,14 @@ public function delete()

$rowset = $table->select($query);

if($rowset->count())
{
//Delete the relations
if($result = $rowset->delete())
{
//Delete the tag
if(!$this->row) {
$result = parent::delete();
}
}
//Delete the relations
if($rowset->count()) {
$result = $rowset->delete();
}

//Delete the tag
if(!$this->row) {
$result = parent::delete();
}

return $result;
Expand Down

0 comments on commit bfa165d

Please sign in to comment.