Moodle
  1. Moodle
  2. MDL-31160

block_navigation::trim_left always returns '...'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Navigation
    • Labels:
    • Testing Instructions:
      Hide
      1. Log in as admin
      2. Add a file resource with a really long name to a course.
      3. Edit the navigation blocks settings a set it to trim left.
      4. Browse the course and make sure you get a ...fileresource in the navigation.
      Show
      Log in as admin Add a file resource with a really long name to a course. Edit the navigation blocks settings a set it to trim left. Browse the course and make sure you get a ...fileresource in the navigation.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-31160-m23

      Description

      The trim_left method of block_navigation in blocks/navigation/block_navigation.php always returns the string "..." as it's implementation fails to pass the length parameter to textlib::substr. This makes the length parameter of textlib::substr always be null so textlib::substr always returns an empty string.

      A patch is included (based off version 2011120500.01).

        Gliffy Diagrams

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: