Moodle

Missing "shorten text" of assignments names on gradebook

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.5
  • Component/s: Gradebook, Libraries
  • Labels:
    None
  • Environment:
    Solaris, Apache 2, PHP 5, MySQL 5
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

On page /grade/report/grader/index.php?id=2 (grader report) some assignments titles are missing.

E.g. shorten_text('<a href="http://edu.krasu.ru/mod/assignment/grade.php?id=3235">?????????????? ??????? ? ?????? 12 (80 ??????)</a>') equals <a href="http://edu.krasu.ru/mod/assignment/grade....</a>.

Problem in lib/moodlelib.php/shorten_text(). It doesn't 's process national characters correctly. I fix it by replace line:

$content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));

to line:

$content_length = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2])); // mb_strlen!

and line:

$truncate .= substr($line_matchings[2], 0, $left+$entities_length);

to line:

$truncate .= mb_substr($line_matchings[2], 0, $left+$entities_length); // mb_substr!

Activity

Hide
Nicolas Connault added a comment -

I don't think this is an issue anymore.

Show
Nicolas Connault added a comment - I don't think this is an issue anymore.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: