Tracker: MDL-11879
Date: April 9, 2008
Moodle Version: 1.8.4
Comment:
Recently I had a similar issue with Moodle 1.8.4+ (2007021540). The site had been upgraded previously however the Add Group feature was not used directly after the upgrade. Subsequently the Add Group function would fail with error [erroreditgroup]. After examining the database I verified the previous issue and the fix for this. Of course this is not a real bug. Here is my deployment of a database table set update for reference. If you are experiencing this error you may want to verify your mdl_group tables against mySQL script that fixed our issues.
--Filename: moodle_addgroups_tables.sql
–
-- MySQL SQL Script fix for MDL-11879
– Tested on Moodle 1.8.4+ (2007021540) only
– Desc: Addressed error [erroreditgroup]
– Auth: John T. Macklin
– RLAdmin/Programmer
– Host: localhost
– Server version: 4.1.22
– PHP Version: 5.2.3
– SQL File to fix course group issue Tracker http://tracker.moodle.org/browse/MDL-11879
– Deployed on test site 4/9/2008 11:43:06 AM with same issue and error reproduced.
– Tracker Issue: Trying to create a group results in : [[erroreditgroup]]
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
–
-- Database: `rltest_moodle`
–
– --------------------------------------------------------
–
-- Table structure for table `mdl_groups`
–
CREATE TABLE IF NOT EXISTS `mdl_groups` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(254) NOT NULL default '',
`description` text,
`enrolmentkey` varchar(50) NOT NULL default '',
`lang` varchar(30) NOT NULL default 'en',
`theme` varchar(50) NOT NULL default '',
`picture` int(10) unsigned NOT NULL default '0',
`hidepicture` tinyint(1) unsigned NOT NULL default '0',
`timecreated` int(10) unsigned NOT NULL default '0',
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='Each record is a group in a course.' AUTO_INCREMENT=41 ;
–
-- Table structure for table `mdl_groups_courses_groupings`
–
CREATE TABLE IF NOT EXISTS `mdl_groups_courses_groupings` (
`id` bigint(10) NOT NULL auto_increment,
`courseid` bigint(10) unsigned NOT NULL default '0',
`groupingid` bigint(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `mdl_groucourgrou_cougro2_uix` (`courseid`,`groupingid`),
KEY `mdl_groucourgrou_cou2_ix` (`courseid`),
KEY `mdl_groucourgrou_gro2_ix` (`groupingid`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='Link a grouping to a course (or the site).' AUTO_INCREMENT=1 ;
–
-- Table structure for table `mdl_groups_courses_groups`
–
CREATE TABLE IF NOT EXISTS `mdl_groups_courses_groups` (
`id` bigint(10) NOT NULL auto_increment,
`courseid` bigint(10) unsigned NOT NULL default '0',
`groupid` bigint(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `mdl_groucourgrou_cougro_uix` (`courseid`,`groupid`),
KEY `mdl_groucourgrou_cou_ix` (`courseid`),
KEY `mdl_groucourgrou_gro_ix` (`groupid`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='Link a group to a course (or the site).' AUTO_INCREMENT=6 ;
–
-- Default data for table `mdl_groups_courses_groups`
–
INSERT INTO `mdl_groups_courses_groups` VALUES(1, 2, 1);
INSERT INTO `mdl_groups_courses_groups` VALUES(2, 2, 2);
INSERT INTO `mdl_groups_courses_groups` VALUES(3, 2, 3);
INSERT INTO `mdl_groups_courses_groups` VALUES(4, 2, 4);
INSERT INTO `mdl_groups_courses_groups` VALUES(5, 2, 5);
–
-- Table structure for table `mdl_groups_groupings`
–
CREATE TABLE IF NOT EXISTS `mdl_groups_groupings` (
`id` bigint(10) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` text,
`timecreated` bigint(10) unsigned NOT NULL default '0',
`viewowngroup` tinyint(1) unsigned NOT NULL default '1',
`viewallgroupsmembers` tinyint(1) unsigned NOT NULL default '0',
`viewallgroupsactivities` tinyint(1) unsigned NOT NULL default '0',
`teachersgroupmark` tinyint(1) unsigned NOT NULL default '0',
`teachersgroupview` tinyint(1) unsigned NOT NULL default '0',
`teachersoverride` tinyint(1) unsigned NOT NULL default '0',
`teacherdeletable` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='A grouping is a collection of groups.' AUTO_INCREMENT=1 ;
–
-- Table structure for table `mdl_groups_groupings_groups`
–
CREATE TABLE IF NOT EXISTS `mdl_groups_groupings_groups` (
`id` bigint(10) NOT NULL auto_increment,
`groupingid` bigint(10) unsigned NOT NULL default '0',
`groupid` bigint(10) unsigned NOT NULL default '0',
`timeadded` bigint(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `mdl_grougrougrou_grogro_uix` (`groupingid`,`groupid`),
KEY `mdl_grougrougrou_gro_ix` (`groupingid`),
KEY `mdl_grougrougrou_gro2_ix` (`groupid`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='Link a group to a grouping.' AUTO_INCREMENT=1 ;
–
-- Table structure for table `mdl_groups_members`
–
CREATE TABLE IF NOT EXISTS `mdl_groups_members` (
`id` int(10) unsigned NOT NULL auto_increment,
`groupid` int(10) unsigned NOT NULL default '0',
`userid` int(10) unsigned NOT NULL default '0',
`timeadded` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `groupid` (`groupid`),
KEY `userid` (`userid`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COMMENT='Lists memberships of users to groups' AUTO_INCREMENT=309 ;
–
-- Table structure for table `mdl_group_membership`
–
CREATE TABLE IF NOT EXISTS `mdl_group_membership` (
`ident` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0' COMMENT '-> users.ident',
`group_id` int(11) NOT NULL default '0' COMMENT '-> groups.ident',
PRIMARY KEY (`ident`),
KEY `user_id` (`user_id`,`group_id`)
) Engine=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
– Notes:
– Can use mysql batch mode to import as sql script file.
– Can also use phpMyAdmin to Import sql scrtipt file.
– Cheers Keep Moodeling !!! ;-{)
I get the same error when I try to create a group named "Conducteur de travaux - groupe 1" in a meta course with Moodle 1.8.2.
I get the same error when I try to create a group named "g 4" in a course that is not a meta course.