Merge branch 'MDL-33681' of git://github.com/timhunt/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2012-06-13 00:06:26 +02:00
commit dbe4bcc959
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ function callback_topics_definition() {
function callback_topics_get_section_name($course, $section) { function callback_topics_get_section_name($course, $section) {
// We can't add a node without any text // We can't add a node without any text
if (!empty($section->name)) { if ((string)$section->name !== '') {
return format_string($section->name, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))); return format_string($section->name, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
} else if ($section->section == 0) { } else if ($section->section == 0) {
return get_string('section0name', 'format_topics'); return get_string('section0name', 'format_topics');

View file

@ -66,7 +66,7 @@ function callback_weeks_definition() {
*/ */
function callback_weeks_get_section_name($course, $section) { function callback_weeks_get_section_name($course, $section) {
// We can't add a node without text // We can't add a node without text
if (!empty($section->name)) { if ((string)$section->name !== '') {
// Return the name the user set. // Return the name the user set.
return format_string($section->name, true, array('context' => context_course::instance($course->id))); return format_string($section->name, true, array('context' => context_course::instance($course->id)));
} else if ($section->section == 0) { } else if ($section->section == 0) {