Groups broken issue after upgrade to 1.9

Groups broken issue after upgrade to 1.9

by Brian Lockwood -
Number of replies: 2
If you have not contaminated your database then this post http://moodle.org/mod/forum/discuss.php?d=104406#p461763 should get you going.

If it doesn't then the following will give you a set of empty groups but you will at least be able to make new ones without 'error on creating group' happening.

In my upgrade, id was not made autoincrement in the mdl_groups table and fixing this is what I think fixed groups.

The problem in my case was that the uprade did not make the new tables quite correctly. By the time I worked the solution out I could not restore my original groups to the live moodle because people were working on it and to take everyone back to the restore point was not worth it.

The structure of the two tables should be

mdl_groups_members -

Field name Type Allow nulls? Key Default value Extras
id bigint(10) unsigned No Primary
auto_increment
groupid bigint(10) unsigned No Indexed 0
userid bigint(10) unsigned No Indexed 0
timeadded bigint(10) unsigned No None 0


mdl_groups as follows. In my upgrade, id was not made autoincrement and fixing this is what I think fixed groups.

Field name Type Allow nulls? Key Default value Extras
id bigint(10) unsigned No Primary
auto_increment
courseid bigint(10) unsigned No Indexed

name varchar(254) No None

description text Yes None

enrolmentkey varchar(50) Yes None

picture bigint(10) unsigned No None 0
hidepicture tinyint(1) unsigned No None 0
timecreated bigint(10) unsigned No None 0
timemodified bigint(10) unsigned No None 0





Average of ratings: Useful (1)
In reply to Brian Lockwood

Re: Groups broken issue after upgrade to 1.9

by Brian Lockwood -
Why I did not see this at the time I do not know but the same issue affects the id field in mdl_groups_members.

So the mdl_groups problem stops you adding groups and the mdl_groups_members problem stops you adding members to that group.
In reply to Brian Lockwood

Re: Groups broken issue after upgrade to 1.9

by jeff rouse -
My issue was similar but different.

Likewise, I had upgraded 1.5 -> 1.6 [skipping 1.7 as advised] -> 1.8 -> 1.9.

In my version of 1.9, the "auto-increment" was set as suggested here and elsewhere.

However, in my mdl_groups table, there was no row/field for "courseid".

Using PHPMyAdmin, I manually added the row after "id" and set it as noted above.

When I went back into Moodle to add a group, it worked as it is supposed to...