$USER->get('grouproles') returning values for deleted groups

Bug #1599305 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
15.04
Fix Released
High
Unassigned
15.10
Fix Released
High
Unassigned
16.04
Fix Released
High
Unassigned

Bug Description

To test:

1) Have a Mahara site with production mode set to off

2) Create a new user and login as that user

3) Create a group then delete the group

4) Create a page and add an image block to the page

5) Select the 'group files' tab - there should be nothing to select

6) Click the 'remove' link for the configuration form

7) Navigate away and you should see these errors:

[WAR] 33 (lib/form/elements/filebrowser.php:380) Undefined offset: 0
[WAR] 33 (lib/form/elements/filebrowser.php:380) Trying to get property of non-object

The reason for this is the $USER->get('grouproles') still holds the role to the deleted group even if you log out and back in again.

We should only populate the grouproles with roles to non-deleted groups.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/6651

Changed in mahara:
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6651
Committed: https://git.mahara.org/mahara/mahara/commit/8b93bf616a93666af32bafe36be1470802c0236e
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 8b93bf616a93666af32bafe36be1470802c0236e
Author: Robert Lyon <email address hidden>
Date: Wed Jul 6 10:04:37 2016 +1200

Bug 1599305: Set users 'grouproles' to only contain undeleted groups

And also update the current user's group roles on group deletion

behatnotneeded

Change-Id: Id32ea6b0ba95a4057c1a84e860aa2ded3879f8b0
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "16.04_STABLE" branch: https://reviews.mahara.org/6683

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/6684

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/6685

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6685
Committed: https://git.mahara.org/mahara/mahara/commit/aeb91f9e16ed87cef198f0b26c60a0a1bc4646ac
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit aeb91f9e16ed87cef198f0b26c60a0a1bc4646ac
Author: Robert Lyon <email address hidden>
Date: Wed Jul 6 10:04:37 2016 +1200

Bug 1599305: Set users 'grouproles' to only contain undeleted groups

And also update the current user's group roles on group deletion

behatnotneeded

Change-Id: Id32ea6b0ba95a4057c1a84e860aa2ded3879f8b0
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 8b93bf616a93666af32bafe36be1470802c0236e)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6684
Committed: https://git.mahara.org/mahara/mahara/commit/ff0e740953a43999677896c25a12138ea29748ab
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit ff0e740953a43999677896c25a12138ea29748ab
Author: Robert Lyon <email address hidden>
Date: Wed Jul 6 10:04:37 2016 +1200

Bug 1599305: Set users 'grouproles' to only contain undeleted groups

And also update the current user's group roles on group deletion

behatnotneeded

Change-Id: Id32ea6b0ba95a4057c1a84e860aa2ded3879f8b0
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 8b93bf616a93666af32bafe36be1470802c0236e)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6683
Committed: https://git.mahara.org/mahara/mahara/commit/36cf8e7231caa3bc643f1ade89d48fd1c8115b66
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.04_STABLE

commit 36cf8e7231caa3bc643f1ade89d48fd1c8115b66
Author: Robert Lyon <email address hidden>
Date: Wed Jul 6 10:04:37 2016 +1200

Bug 1599305: Set users 'grouproles' to only contain undeleted groups

And also update the current user's group roles on group deletion

behatnotneeded

Change-Id: Id32ea6b0ba95a4057c1a84e860aa2ded3879f8b0
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 8b93bf616a93666af32bafe36be1470802c0236e)

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.