Convert mixed-case group shortnames
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Mahara: master
With the new functionality added to allow admins to update the group shortname, an interesting paradigm now exists.
Currently, we allow mixed case alphanumeric characters for the shortname.
A variable was introduced 'retainshortname' to make sure the shortname entered (via the webservice and / or CSV upload ) is valid and follows the shortname naming conventions.
In the group_create() function (htdocs/
1. If the user specifies a mixed case shortname in the CSV upload, the generated shortname will not match as it always converts everything to lowercase.
2. If the user specifies a shortname completely unrelated to the display name, the shortname will also not match. i.e. shortname = 'abc' displayname = 'My Group'. The generated shortname will be 'mygroup'.
I'm of the opinion that the following needs to be modified:
1. The shortname should be alphanumeric lower case characters.
2. A common validation function needs to be created so the edit group, upload csv, and webservice group creation are using the same rules. Therefore, we won't have multiple validation functions for the same thing throughout the code.
3. We can eliminate the 'retainshortname' flag as we would have already validated the shortname if it got to the group_create() function.
4. An upgrade script to convert mixed case shortnames to lower case.
Changed in mahara: | |
milestone: | 16.10.0 → 16.10.1 |
Changed in mahara: | |
milestone: | 16.10.1 → 17.04.0 |
Changed in mahara: | |
milestone: | 17.04.0 → 17.10.0 |
Hi Ghada,
When setting up shortnames for groups for the CSV file, I tend to work with dashes / underscores so as to separate characters a bit better to make the shortname more readable. Could this be retained as we do also use dashes for clean URLs for example?
Cheers
Kristina