Moodle

Cannot create a Group

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not a bug
  • Affects Version/s: 1.8.3
  • Fix Version/s: None
  • Component/s: Groups
  • Labels:
    None
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE

Description

Get this error when trying to create a group: [[erroreditgroup]]

Activity

Hide
Frédéric Hoogstoel added a comment - - edited

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.

Show
Frédéric Hoogstoel added a comment - - edited 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.
Hide
Jeffery Watkins added a comment -

On my site, this was caused by the courseid field not being present in the mdl_groups table. For some reason it was not created during the last upgrade.

Eloy helped me by manually creating in and then populating it by pulling the course id data from the different activities that use Groups, such as Forums and Wikis. Thanks Eloy!!!

This issue is closed for me.

Show
Jeffery Watkins added a comment - On my site, this was caused by the courseid field not being present in the mdl_groups table. For some reason it was not created during the last upgrade. Eloy helped me by manually creating in and then populating it by pulling the course id data from the different activities that use Groups, such as Forums and Wikis. Thanks Eloy!!! This issue is closed for me.
Hide
Petr Škoda (skodak) added a comment -

thanks for info

Show
Petr Škoda (skodak) added a comment - thanks for info
Hide
Imthias added a comment -

I encountered the same problem after an upgrade from 1.6 to 1.8.

I also tried pulling the course id from the old DB (ver 1.6) and to the new table (mdl_groups) but still get the same error.

Could i have more details as to how to go about solving this.

Appreciate. Thanks.

Show
Imthias added a comment - I encountered the same problem after an upgrade from 1.6 to 1.8. I also tried pulling the course id from the old DB (ver 1.6) and to the new table (mdl_groups) but still get the same error. Could i have more details as to how to go about solving this. Appreciate. Thanks.
Hide
John T. Macklin added a comment -

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 !!! ;-{)

Show
John T. Macklin added a comment - 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 !!! ;-{)
Hide
John T. Macklin added a comment -

phpMyAdmin SQL Script file for this issue. Can just import into your database of course after backup.

Backup database:

mysqldump -u [user] -p[passwd] [database] > database_backup_20080309.sql

Restore database:

mysql -u[user] -p[passwd] [database] < database_backup_20080309.sql

Show
John T. Macklin added a comment - phpMyAdmin SQL Script file for this issue. Can just import into your database of course after backup. Backup database: mysqldump -u [user] -p[passwd] [database] > database_backup_20080309.sql Restore database: mysql -u[user] -p[passwd] [database] < database_backup_20080309.sql

People

Dates

  • Created:
    Updated:
    Resolved: