Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25646

html_writer is used in mediaplugin but is not defined

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.10
    • Fix Version/s: 1.9.11
    • Component/s: Filters
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Issue details:

      The filter_mediaplugin_ogg_callback(...) and filter_mediaplugin_ogv_callback(...) methods in filter/mediaplugin/filter.php reference the html_writer class, which is not defined in Moodle 1.9.10+ (build 20101103). This causes a fatal PHP error when those methods are called.

      Solution details:

      We added this custom class:

      /usr/share/php/html_writer.php:
      <?php
      class html_writer {
      function link($url, $text)

      { return '<a href="' . $url . '">' . $text . '</a>'; }

      }
      ?>

      (/usr/share/php is in our installation's include_path.)

      Then we added this to our Moodle installation's config.php:

      require_once 'html_writer.php';

      We chose to write this code instead of fully backporting the html_writer class and other required functions from Moodle 2.0 because only this code appears to be needed at this time.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    21/Feb/11