Add group shortnames to manually created groups

Bug #826649 reported by Kristina Hoeppner
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Wishlist
Dmitrii Metelkin

Bug Description

In Mahara 1.5 groups can be created via a CSV file and associated with an institution. Often, however, groups can be created manually, but a CSV upload of the members may be preferred. Thus, it would be good if manually created groups could also have a short name (that is also displayed to the admin) so that members can be added via CSV.

This wishlist item needs a bit more thinking because the CSV feature allows institution admins to create groups that are associated with their institution (though it doesn't do anything with that information yet, I think) but not on a site level. Furthermore, if groups already exist, they would need to be assigned a short name. And then who can add members as they are not associated with an institution yet?

Furthermore, the CSV upload is also only beneficial if users don't change their user names. An admin must be aware of that or his upload may not work most of the time. Thus, user names should be locked.

description: updated
Revision history for this message
François Marier (fmarier) wrote :

Marking this bug "incomplete" as a reminder that it needs to be fleshed out more before we can resolve it.

Changed in mahara:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mahara because there has been no activity for 60 days.]

Changed in mahara:
status: Incomplete → Expired
Melissa Draper (melissa)
Changed in mahara:
status: Expired → Confirmed
Revision history for this message
Gordon McLeod (g-mcleod1) wrote :

Hi,
Just came across this as I've run into the same issue on version 1.6.3
We've created a number of groups with pre-populated material that students will work through - but then encounter the issue that we can't csv add the users to the groups as the groups were created manually.

Could a simple workaround be to allow updating of existing groups by csv (perhaps only updating blank fields)? This would require an export of the existing group list with the required fields, followed by an upload of a modified copy of the same file with the short names added. From a previous issue I'd suggest enable updating the group institution field too. This would then allow site admins to update legacy groups so that users could be csv enrolled.

As a real quick & dirty option, couldn't the shortname field simply be updated with a copy of the full name of that group if shortname field was blank? I don't know what the field limitations might be as to whether that option would work - but if it was viable then with the correct syntax it would be fairly easy to achieve as a script - ideally added as a button for admins for ease of use rather than having to run the script backend.

Regards, Gordon.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I agree, the group shortname could be automatically generated, from the group name. In fact, "group.name" in the database is 128 characters and guaranteed to be unique, by a uniqueness constraint. "group.shortname" is 255 characters (paradoxically, "shortname" is twice the size of "name"!), so we could easily just copy it across at the time of group creation. If a group with that shortname already existed (due to CSV uploads) we could use some kind of simple fix like adding a "2" to the end of it. Since group.shortname is so much longer than group.name, there's plenty of space to do that.

It would also make sense to make the group shortname visible, at least to site/institution admins on the group search page. Perhaps via an extra column on that page. For that matter, you could even make this data visible, even configurable, from the group editing page. Just put it towards the bottom under "advanced".

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

The short name should definitely be displayed somewhere so it can be used. Displaying the shortname in the advanced group settings would be good so that admins can see it easily. However, I'm not so sure about group admins being able to edit the group shortname as that might conflict with the work the institution admin does.

Imagine, a group admin not liking their group shortname and changing it to something else while the institution admin is about to upload users to the group and suddenly can't find that group anymore having to go searching for it again. Currently, group shortnames are only usable by institution and site admins and they aren't used by group admins for anything. They can choose the name of their group when they work with clean URLs, but other than updating group membership and group settings in bulk by an institution / site admin, it's not being used. Thus, displaying it in the group interface for admins only might be better or as non-editable field in the group settings page.

Revision history for this message
Gordon McLeod (g-mcleod1) wrote :

Hi,
I'd be more than happy to see the shortname auto generated based on group name. That would then solve this for all new groups - but would it also resolve for legacy groups or would that need additional work to generate an amendment 'if group.shortname="" then group.shortname="group.name"? It would be nice if the blank fields could also be auto generated during site upgrade without admin user action - but if that isn't possible a button/link available to site administrators to 'generate missing shortnames' as part of group administration section of the admin panel would be great.

I agree that displaying the shortname to group admins is needed so that they can refer to it when making requests for changes but it makes sense that the ability to alter the name should be restricted to institution and site admins.

This might seem like a daft question but I'm asking from a position of ignorance as I'm keen to learn. What is group.shortname actually needed for? Could it just be stripped out and references to it renamed to group.name instead? The only reason I can think of for having 2 separate names for these fields is to have a short character friendly name that can be used for csv import - but as Aaron pointed out it doesn't seem to have that constraint.

Regards, Gordon.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Gordon,

As far as I can tell, shortname only exists in order to be a more data-entry friendly name used by CSV. The comments indicate that it is also meant to be used by other automated systems like webservices, but currently CSV's the only one. The LDAP sync functionality we're adding in 1.8 (which allows groups to be automatically populated by LDAP data) also uses it to uniquely identify Groups.

So, there is some call for having a non-changeable identifier for the group. And, well, you could just use the group's ID number, which is a non-changing integer assigned automatically by the database, but I guess it's probably more user-friendly to have something alphanumeric, hence the shortname.

So it sounds like we'd want this:

1. When a group is manually created, assign it a unique shortname based on its name
2. Add a bit to the upgrade script to automatically assign a unique shortname based on its name, for each existing group that doesn't have one. (This should be trivially easy)
3. Display the group shortname as a non-editable field on the group's config page (/group/edit.php?id=1)
4. Possibly, for institution admins and site admins, make the group shortname be an editable field on the group config page.

I think items 1, 2, and 3 together are "bite-sized". Item 4 is slightly more difficult.

Cheers,
Aaron

Aaron Wells (u-aaronw)
tags: added: bite-sized
Revision history for this message
Gordon McLeod (g-mcleod1) wrote :

Hi Aaron,

Thanks for clarifying that shortname has other potential uses.

I'd certainly vote for your suggested solution - sounds ideal to me. If #4 is more complex I'd guess that can wait - the others are more of a priority. I think changing the name is more of a nice to have than a need to have - and if it's reused elsewhere in the database it would have knock on effects so I can see why that would be more work.

Cheers, Gordon.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

The suggestions also sound good to me.

Aaron Wells (u-aaronw)
Changed in mahara:
status: Confirmed → Triaged
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Note for Hugh: If you tackle this with the Academy students, you could split this up into a couple of separate bugs, e.g. maybe #4 if it is too hard.

tags: added: academy
Changed in mahara:
assignee: nobody → Dmitrii Metelkin (dmitriim)
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Dmitrii will look into:

1. When a group is manually created, assign it a unique shortname based on its name.

2. Add a bit to the upgrade script to automatically assign a unique shortname based on its name, for each existing group that doesn't have one. (This should be trivially easy).

3. Display the group shortname as a non-editable field on the group's config page (e.g. /group/edit.php?id=1).

4. Make the group shortname an editable field on the group config page for site administrators. Note: this functionality will be available to site adminstrators only as institutions don't really have groups assigned and it could be too far reaching for institution admins to change group shortnames for groups that had been created by other institutions (e.g. if you set up an Alumni institution). The site admin would still need to add themselves as admin to the group in order to make that change. Right now, a site admin can only change group settings (except for quota and administrators) when they are group admins themselves.

Changed in mahara:
milestone: none → 16.10.0
status: Triaged → In Progress
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Additional pieces of work for the group enhancement are:

bug #1595028 and bug #1595026 and bug #1595025

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/6611

Revision history for this message
LIsa (lisadunmire) wrote :

The attached image is a comment for the patch (see there for more information).

We tested:

1. On master, set up a few manual groups and also CSv file created ones.
2. Upgrade the site to the patch.
3. Check under Admin -> Groups that all groups had a short name.
4. Check that site admin can edit the short name on the group settings page when she is an admin of a group.
5. Check that regular users and institution admins can't change the group name, but only see the short name as non-editable field.

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

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

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

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

commit db0e9b48d3cb0d6d25d104d982453121530a3432
Author: Dmitrii Metelkin <email address hidden>
Date: Tue Jun 21 17:02:12 2016 +1000

Bug #826649: add group shortnames to manually created groups

behatnotneeded

Change-Id: Ic5d4fbb3faa16afb893e45c5303449122c7cd368

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Thank you to ANU for funding this feature.

tags: added: nominatedfeature
removed: academy bite-sized group
Changed in mahara:
status: Fix Committed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6619
Committed: https://git.mahara.org/mahara/mahara/commit/59936d5f93b1acd91facec1ab2b61a90b02f4912
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 59936d5f93b1acd91facec1ab2b61a90b02f4912
Author: Dmitrii Metelkin <email address hidden>
Date: Fri Jun 24 10:34:48 2016 +1000

Bug #826649: move generation of institution name to lib/institution.php

behatnotneeded - backend change so existing tests should be sufficient

Change-Id: I3013ce5d19e043134df327608e13b4b4fa205300
Signed-off-by: Dmitrii Metelkin <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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