Group group_create() wrong error if shortname is not lowercase

Bug #1711485 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

If you try to create a group via csv with a non-lowecase shortname, eg 'Cats' it complains:

"group_create: The supplied shortname 'Cats' is already taken. This shortname 'cats' is available."

It should do a different complaint, eg:

"group_create: The supplied shortname 'Cats' needs to be lower-case, eg 'cats'."

Revision history for this message
Robert Lyon (robertl-9) wrote :

This is due to shortname only allowed to be lowercase

Changed in mahara:
milestone: none → 17.10.0
importance: Undecided → Medium
status: New → In Progress
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/7937

Revision history for this message
Niranjan (niranjan528) wrote :

Here are the test cases and test results for this bug

URL: https://bugs.launchpad.net/mahara/+bug/1711485

Scenario 1:

Bug description: Creating a group via CSV is throwing incorrect error message if short name is not lower case.

Environment to be tested: Master branch
Browser testing: Not applicable

Steps to Reproduce:

1. Log in as a site admin user.
2. Navigate to Main menu > Groups.
3. Click the ‘Create group’ button.
4. Enter ‘Group name’ as ‘Mahara’.
5. Click the ‘Save group’ button.
6. Click the ‘Settings’ button.
7. Change the 'Short name' to ‘Test’.
8. Click the ‘Save group’ button.
9. Now navigate to Administration menu > Administer groups.
10. Click on ‘Export groups in CSV format’.
11. Navigate to Administration menu > Groups > Add groups by CSV.
12. Switch ‘Update groups’ to ‘Yes’.
13. Choose the saved file at step 8 and click on ‘Add groups by CSV’ button.

Expected Result: An error message is displayed as

 "group_create: The supplied short name 'Test' needs to be lower-case, eg 'test'.”

Actual Result: NO error message is displayed, this test case is a fail.

Scenario 2:

Bug description: Creating a new group via a CSV file and have an upper case short name.

Environment to be tested: Master branch
Browser testing: Not applicable

Steps to Reproduce:

Precondition: Create a CSV file for a new group with short name as ‘Groupone’.

1. Navigate to Administration menu > Add groups by CSV.
2. Click on ‘Choose file’ from ‘CSV file’ field.
3. Select the CSV file (see precondition).
4. Click the ‘Add groups by CSV’ button.

Expected Result: An error message is displayed as

 "group_create: The supplied short name 'Test' needs to be lowercase, eg 'test'.
Actual Result: Error message is displayed correct but it says the site is unavailable and the following message is displayed.
“Mahara: Site unavailable
Something in the way you're interacting with Mahara is causing an error.
Details if any, follow:”

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

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

commit 801b3308831d74a222507630ef1fec455ae41344
Author: Robert Lyon <email address hidden>
Date: Fri Aug 18 14:28:00 2017 +1200

Bug 1711485: Throw correct error of group create

When the shortname is uppercase and we upload groups via csv

Also forcing shortname to be lowercase if editing group shortname

behatnotneeded

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

Robert Lyon (robertl-9)
tags: added: usermanualupdate
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.

Other bug subscribers

Remote bug watches

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