From b28dc9962dc9121d2fb1a8ab3c1b2f5bc94c9705 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 13 Jul 2018 11:14:00 +0100 Subject: [PATCH 1/2] 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 --- libraries/src/Table/Usergroup.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/src/Table/Usergroup.php b/libraries/src/Table/Usergroup.php index 5c9ef105dc172..5f33253249e3d 100644 --- a/libraries/src/Table/Usergroup.php +++ b/libraries/src/Table/Usergroup.php @@ -160,12 +160,12 @@ public function delete($oid = null) if ($this->id == 0) { - throw new \UnexpectedValueException('Global Category not found'); + throw new \UnexpectedValueException('Global 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) @@ -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)) From b30313f6cc14adb17937db65649003bf72208acb Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 13 Jul 2018 13:49:59 +0100 Subject: [PATCH 2/2] Update Usergroup.php --- libraries/src/Table/Usergroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Table/Usergroup.php b/libraries/src/Table/Usergroup.php index 5f33253249e3d..d171de9d9afc4 100644 --- a/libraries/src/Table/Usergroup.php +++ b/libraries/src/Table/Usergroup.php @@ -160,7 +160,7 @@ public function delete($oid = null) if ($this->id == 0) { - throw new \UnexpectedValueException('Global usergroup not found'); + throw new \UnexpectedValueException('Usergroup not found'); } if ($this->parent_id == 0)