User tests: Successful: Unsuccessful:
Pull Request for Issue #28522 (comment).
When deleting one or more usergroups, the lftand rgt values in the #__usergroups table are not recalculated, i.e. the nested set tree is not rebuilt.
This PR adds the missing function call for that purpose to the delete routine of the Usergroup table class.
On a clean, new installation, check with an SQL client (e.g. phpMyAdmin when using MySQL or MariaDB) the content of the #__usergroups as follows:

In backend as a super user and not being member of one of these groups, delete the usergroup "Manager", which will also delete its child group "Administrator". (You can also delete others but then it's on you to calculate the right lftand rgt values to check if this PR is right.)
Check again with an SQL client the content of the #__usergroups with the same SQL query as before.
Result: lftand rgt values in the #__usergroups table haven't changed for the remaining records:

If you want to delete in the next test the same user group as in the test before: Make a new installation.
Apply the patch.
Repeat steps 2 and 3.
Result: lftand rgt values in the #__usergroups table have been recalculated. If you have deleted the group as described above, it should look as follows:

The calculation scheme is as follows for that example:

The lftand rgt values in the #__usergroups table are correctly recalculated.
The lftand rgt values in the #__usergroups table are not recalculated.
None.
When inserting new user groups or moving some around between parent groups, the lftand rgt values in the #__usergroups table are recalculated without this patch using the same function, so I assume the lftand rgt values are still relevant.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
I have tested this item
| Status | Pending | ⇒ | Ready to Commit |
RTC
I can’t believe it, but when looking through the history of the file changed by this PR, it seems to me that what is added by this PR always has been missing.
Maybe it should have been done the other way, remove it completely because for the groups hierarchy it is enough to know the parent group?
| Labels |
Added:
?
?
|
||
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-15 08:44:56 |
| Closed_By | ⇒ | HLeithner | |
| Labels | |||
Thanks
Thanks to testers and mergers ;-)
I have tested this item✅ successfully on 299f4f7
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28684.