Can not add groups via CSV when shortname is not relied on displayname
Bug #1613503 reported by
Son Nguyen
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Robert Lyon |
Bug Description
version: master(16.10)
I got the following message when adding groups via CSV
Mahara: Site unavailable
Something in the way you're interacting with Mahara is causing an error.
Details if any, follow:
group_create: The supplied shortname 'gc' is already taken. This shortname 'groupc' is available.
The content of my CSV file:
shortname,
"gc","Group C","standard"
I have to change the shortname to 'groupc' to make it work.
Is it the new behaviour?
Changed in mahara: | |
status: | New → Fix Committed |
assignee: | nobody → Robert Lyon (robertl-9) |
importance: | Undecided → High |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
in lib/group.php line 357
if (!empty( $data[' shortname' ])) { shortname( $data[' name']) ; $data[' retainshortname '])) {
// make sure it is unique and is correct length
$shortname = group_generate_
// If we want to retain the supplied shortname we need to make sure it can be done
if (!empty(
if ($shortname != $data['shortname']) {
The shortname( $data[' name']) ; shortname( $data[' shortname' ]);
$shortname = group_generate_
should be
$shortname = group_generate_
So that we compare supplied shortname with valid one - which should be the same unless the supplied string contains invalid chars or the valid one is different because the supplied one is taken