Dear Llywelyn,
Thanks I see. Your version contains the code in lib.php:
//Attempts to return a 40 character title for the section icon.
//If section names are set, they are used. Otherwise it scans
//the summary for what looks like the first line.
function _get_title($section) {
$title = is_object($section) && isset($section->name) &&
is_string($section->name)?trim($section->name):'';
if (!empty($title)) {
// Apply filters and clean tags
$title = trim(format_string($section->name, true));
}
if (empty($title)) {
$title = trim(format_text($section->summary));
// Finds first header content. If it doesn't found,
// trying to find first paragraph.
foreach(array('h[1-6]', 'p') as $tag) {
if (preg_match('#<('.$tag.')\b[^>]*>(?P<text>.*?)</\1>#si', $title, $m)) {
if (!_is_empty_text($m['text'])) {
$title = $m['text'];
break;
}
}
}
$title = trim(clean_param($title, PARAM_NOTAGS));
}
if (strlen($title) > 40) {
$title = _text_limit($title, 40);
}
return $title;
}
Which is an old version pre 'renderer.php' Moodle 2.3 changes. The latestish version from - - uses object orientated reuse of common core methods:
$this->section_title($section,$course)
Which is a call to the base '/course/format/renderer.php' method in the method 'section_header' in the file '/course/format/grid/renderer.php' to be consistent with the other formats.
You can get the code from https://github.com/PukunuiAustralia/moodle-courseformat_grid/tree/MOODLE_23_STABLE
The up shot of this is that I consider that truncating the summary text automatically to a maximum of fourty characters when there is no name to be problematic. I had a similar strategy with Collapsed Topics back in Moodle 1.9 and used to get questioned about it. So, rather than a situation with the users saying 'why the xxxx has it just done that', I prefer to empower the user to enter the name as a thought provoking action to good course design.
Cheers,
Gareth