かなり適当ですが...
mode/label/lib.phpの冒頭にある,
function label_add_instance($label) {
/// Given an object containing all the necessary data,
/// (defined by the form in mod.html) this function
/// will create a new instance and return the id number
/// of the new instance.
$textlib = textlib_get_instance();
$label->name = addslashes(strip_tags(format_string(stripslashes($label->content),true)));
// (Shirai): ここから追加
if (strlen($label->name) == 0) $label->name = 'noname';
// (Shirai): ここまで追加
if ($textlib->strlen($label->name) > LABEL_MAX_NAME_LENGTH) {
$label->name = $textlib->substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."...";
}
$label->timemodified = time();
return insert_record("label", $label);
}
function label_update_instance($label) {
/// Given an object containing all the necessary data,
/// (defined by the form in mod.html) this function
/// will update an existing instance with new data.
$textlib = textlib_get_instance();
$label->name = addslashes(strip_tags(format_string(stripslashes($label->content),true)));
// (Shirai): ここから追加
if (strlen($label->name) == 0) $label->name = 'noname';
// (Shirai): ここまで追加
if ($textlib->strlen($label->name) > LABEL_MAX_NAME_LENGTH) {
$label->name = $textlib->substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."...";
}
$label->timemodified = time();
$label->id = $label->instance;
return update_record("label", $label);
}
こうすることで,データベース(mdl_label)のnameの欄は'noname'となり,画面表示も正しく行なえるようになりました.
詳しく調べた訳ではないのですが,$label->nameには日本語も使えるようですし,さらにもし長すぎた場合(50文字以上)は省略していたり('...'を付加)していたりしますので,あまり名前に重要な意味は無さそうですので,多分,大丈夫なのではないかな.
MDL-15205に報告しました.