? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
14 Apr 2020

Pull Request for Issue #28522 (comment).

Summary of Changes

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.

Testing Instructions

  1. 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:
    j3_usergroup-delete-manager_table-before

  2. 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.)

  3. 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:
j3_usergroup-delete-manager_table-after-wrong

  1. If you want to delete in the next test the same user group as in the test before: Make a new installation.

  2. Apply the patch.

  3. 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:
j3_usergroup-delete-manager_table-after-right

The calculation scheme is as follows for that example:
usergroup-tree-calculation

Expected result

The lftand rgt values in the #__usergroups table are correctly recalculated.

Actual result

The lftand rgt values in the #__usergroups table are not recalculated.

Documentation Changes Required

None.

Additional information

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.

avatar richard67 richard67 - open - 14 Apr 2020
avatar richard67 richard67 - change - 14 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Apr 2020
Category Libraries
avatar richard67 richard67 - change - 14 Apr 2020
The description was changed
avatar richard67 richard67 - edited - 14 Apr 2020
avatar richard67 richard67 - change - 14 Apr 2020
The description was changed
avatar richard67 richard67 - edited - 14 Apr 2020
avatar richard67 richard67 - change - 14 Apr 2020
The description was changed
avatar richard67 richard67 - edited - 14 Apr 2020
avatar richard67 richard67 - change - 14 Apr 2020
The description was changed
avatar richard67 richard67 - edited - 14 Apr 2020
avatar richard67 richard67 - change - 14 Apr 2020
The description was changed
avatar richard67 richard67 - edited - 14 Apr 2020
avatar chmst
chmst - comment - 14 Apr 2020

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.

avatar chmst chmst - test_item - 14 Apr 2020 - Tested successfully
avatar jwaisner
jwaisner - comment - 14 Apr 2020

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.

avatar jwaisner jwaisner - test_item - 14 Apr 2020 - Tested successfully
avatar jwaisner jwaisner - change - 14 Apr 2020
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 14 Apr 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28684.

avatar richard67
richard67 - comment - 15 Apr 2020

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.

avatar richard67
richard67 - comment - 15 Apr 2020

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?

avatar richard67 richard67 - change - 15 Apr 2020
Labels Added: ? ?
avatar HLeithner HLeithner - change - 15 Apr 2020
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
avatar HLeithner HLeithner - close - 15 Apr 2020
avatar HLeithner HLeithner - merge - 15 Apr 2020
avatar HLeithner
HLeithner - comment - 15 Apr 2020

Thanks

avatar richard67
richard67 - comment - 15 Apr 2020

Thanks to testers and mergers ;-)

Add a Comment

Login with GitHub to post a comment