mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-15304 fixed empty label names coming from restore; merged from MOODLE_19_STABLE
This commit is contained in:
parent
67d4dfb84b
commit
d02f193404
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user