From: skodak Date: Sat, 5 Jul 2008 09:37:30 +0000 (+0000) Subject: MDL-15304 fixed empty label names coming from restore; merged from MOODLE_19_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d02f193404d61168fcebce093d66eea3189f8b78;p=moodle.git MDL-15304 fixed empty label names coming from restore; merged from MOODLE_19_STABLE --- diff --git a/mod/label/lib.php b/mod/label/lib.php index 3e1a8a086e..bbcc4f1e8a 100644 --- a/mod/label/lib.php +++ b/mod/label/lib.php @@ -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);