Skip to content

Commit

Permalink
Exceptions in Joomla\CMS\Table\Usergroup refer to categories (#21098)
Browse files Browse the repository at this point in the history
* Exceptions in Joomla\CMS\Table\Usergroup refer to categories

Pull Request for Issue #21092 .

### Summary of Changes
remove todo that is clearly a copy paste error from somewhere else
change exception message to usergroups from catergory

NOTE the first exception` if ($this->id == 0)`
I am not sure if that should even be present - doesn't look like it to me - please advise

* Update Usergroup.php
  • Loading branch information
brianteeman authored and wilsonge committed Jul 13, 2018
1 parent bbd7bdd commit aba23aa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libraries/src/Table/Usergroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ public function delete($oid = null)

if ($this->id == 0)
{
throw new \UnexpectedValueException('Global Category not found');
throw new \UnexpectedValueException('Usergroup not found');
}

if ($this->parent_id == 0)
{
throw new \UnexpectedValueException('Root categories cannot be deleted.');
throw new \UnexpectedValueException('Root usergroup cannot be deleted.');
}

if ($this->lft == 0 || $this->rgt == 0)
Expand All @@ -189,9 +189,6 @@ public function delete($oid = null)
throw new \UnexpectedValueException('Left-Right data inconsistency. Cannot delete usergroup.');
}

// Delete the category dependencies
// @todo Remove all related threads, posts and subscriptions

// Delete the usergroup and its children
$query->clear()
->delete($db->quoteName($this->_tbl))
Expand Down

0 comments on commit aba23aa

Please sign in to comment.