in lib/group.php line 357

    if (!empty($data['shortname'])) {
        // make sure it is unique and is correct length
        $shortname = group_generate_shortname($data['name']);
        // If we want to retain the supplied shortname we need to make sure it 
can be done
        if (!empty($data['retainshortname'])) {
            if ($shortname != $data['shortname']) {


The  
   $shortname = group_generate_shortname($data['name']);
should be
   $shortname = group_generate_shortname($data['shortname']);

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

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

Title:
  Can not add groups via CSV when shortname is not relied on displayname

Status in Mahara:
  New

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,displayname,roles
  "gc","Group C","standard"

  I have to change the shortname to 'groupc' to make it work.
  Is it the new behaviour?

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

_______________________________________________
Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to