Fail deleting long name groups
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Daniel Parejo |
Bug Description
When you delete a group, it concatenates '.deleted.'.time() that is about 19 characters. Hence, if your group name is longer than 108 characters it will throw a DB exception for exceeding the 128 characters field for the group name. To avoid this, I've added the following code to function group_delete(
//Daniel Parejo
$delete_name = $group->name;
if (strlen(
}
//End added code
update_
array(
'name' => $delete_name . '.deleted.' . time(), //modified code
'urlid' => null,
),
array(
'id' => $group->id,
)
);
db_commit();
This solution is not perfect since it will fail if two groups that are not different in their 101 first characters are tried to be removed in the same time instant. Still, way better than before, though I think a more solid solution should be implemented.
description: | updated |
tags: | added: groups |
Changed in mahara: | |
milestone: | none → 15.04.0 |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Hi Daniel,
Thank you for your patch. Do you want to put it into our review system at reviews.mahara.org yourself or want one of our developers to do that?
Instructions for getting started with Gerrit, the review system, are at https:/ /wiki.mahara. org/index. php/Developer_ Area/Contributi ng_Code
Cheers
Kristina