← Back to team overview

mahara-contributors team mailing list archive

[Bug 1871280] Re: Allow grouproles to be reset for users when roles updated via webservices

 

Catalyst QA Testing: patch for master - PASSED

Gerrit: https://reviews.mahara.org/#/c/10966/ patch 2
	Bug 1871280: Using correct search with 'Groups I am in' during pagination

Pre-requisites:
a) Site admin creates 12 controlled groups with names prefixed AAGroup, ABGroup, ACGroup, ... ALGroup.
b) Person1 is a member of the first 11 groups AAGroup thru AKGroup.
c) Person2 is not a member of any group.

Steps:
1. Apply patch to master.
2. Log in as site admin and:
   - add two non-admin target users (check database id=2 and id=3)
   - navigate to the Groups home page, note the groups displayed with default 'All my groups' filter set.
3. For each user (id=2 and id=3) in another private/incognito browser window:
   - log in with the target user
   - navigate to the Groups homepage, note the groups displayed with default 'All my groups' filter set
   - Search using the 'Groups I am in' filter, the groups displayed should be the same as previous step.
4. To add more than one user on group creation (simulate web service response) , edit the htdocs/group/edit.php file and change the following line (about line 560+) from:
	$newvalues['members'] = array($USER->get('id') => 'admin');
to:
	$newvalues['members'] = array($USER->get('id') => 'admin', 2 => 'member', 3 => 'member');
5. With the logged in admin user:
   - create a new group named BAGroup.
Expected results: 
   - ✔ the new group's home page displays with three members listed (scroll down)
   - navigate to the Groups home page: 
     * ✔ there are 2 pages to display 13 groups (default 10 per page)
     * ✔ the new group is displayed at the end of the second page
     * ✔ the group filters display the correct results (no change to functionality).
6. In each of Person1 & Person2's browser windows, check the Search filter results.
Expected results: 
   The newly created group is correctly displayed in the results for:
   - All my groups: ✔Person1 12 (new group on second page) & ✔ Person2 1 (single page)
   - Groups I'm in: ✔ Person1 12 (new group on second page) & ✔ Person2 1 (single page)
   - All groups: ✔ both 13 (new group on second page).
   The newly created group is correctly NOT displayed in the results for:
   - Groups I own: ✔ both none
   - Groups I'm invited to: ✔ both none
   - Groups I can join: ✔ both none
   - Groups I'm not in: ✔ Person1 1 (single page) & ✔ Person2 12 (two pages).

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1871280

Title:
  Allow grouproles to be reset for users when roles updated via
  webservices

Status in Mahara:
  In Progress
Status in Mahara 19.04 series:
  Won't Fix
Status in Mahara 19.10 series:
  In Progress
Status in Mahara 20.04 series:
  In Progress
Status in Mahara 20.10 series:
  In Progress

Bug description:
  When creating new groups via webservices while the user is logged in.

  The "group/find.php" search works with a user's grouproles and when a
  group is created via webservice the grouproles are not reset for the
  session. So only after the user logged out and logged in again, the
  group is found with "group/find.php".

  We need to set a flag so that when a person loads anything in mahara
  (eg calls the $user->renew() function) that it resets the group roles
  for the user so they don't have to logout and login again.

  Added from discussion with Robert (2020-05-08):
  The group_add_user() and group_remove_user() functions already call the $USER->reset_grouproles() function - so this patch is only fixing the problem when group_create() is called. In 'normal' Mahara we can't create a group with more than the current user, but via webservice we can create a group with many members at once and that causes this problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1871280/+subscriptions


References