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($groupid, $shortname=null, $institution=null, $notifymembers=true):
This solution is not perfect since it will fail if two groups that are not different in their 101 first characters are tried to remove in the same time instant. Still, way better than before, though I think a more solid solution should be implemented.
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( $groupid, $shortname=null, $institution=null, $notifymembers= true):
//Daniel Parejo $delete_ name) > 100) {
$delete_ name = substr( $delete_ name, 0, 100) . '(...)';
$delete_name = $group->name;
if (strlen(
}
//End added code
update_ record( 'group' ,
'deleted' => 1,
'shortname ' => null,
'instituti on' => null,
'category' => null,
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 remove in the same time instant. Still, way better than before, though I think a more solid solution should be implemented.