Maximum length of text entered into the NAME item

Re: Maximum length of text entered into the NAME item

by Matt Campbell -
Number of replies: 0
If you look in your database for mdl_resource (the mdl_ prefix may be different depending on your settings in config.php), you'll see that the name field is varchar(255), which means that it can hold up to 255 characters. If you need more, you'll need to change this. Sometimes this is fine, other times it may have a negative affect.

If you have a test install, it's best to do this there first and see what happens. At the very least, please make a backup of your database first so you can recover.

After you've backed up the database, run the following command:

ALTER TABLE `mdl_resource` CHANGE `name` `name` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL

This will set the name field to text, which allows 65535 characters.

This is for MySQL, if you're running on a different database you may have to research what the proper command and type would be.

Thanks,
Matt