MDL-15304 fixed empty label names coming from restore; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-07-05 09:37:30 +00:00
parent 67d4dfb84b
commit d02f193404

View File

@ -85,6 +85,11 @@ function label_get_coursemodule_info($coursemodule) {
global $DB;
if ($label = $DB->get_record('label', array('id'=>$coursemodule->instance), 'id, content, name')) {
if (empty($label->name)) {
// label name missing, fix it
$label->name = "label{$label->id}";
$DB->set_field('label', 'name', $label->name, array('id'=>$label->id));
}
$info = new object();
$info->extra = urlencode($label->content);
$info->name = urlencode($label->name);