Moodle
  1. Moodle
  2. MDL-28100

page resource is using deprecated courseid in calling format_text

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.1, 2.2
    • Fix Version/s: 2.0.4, 2.1.1
    • Component/s: Resource
    • Labels:
      None
    • Database:
      Any
    • Testing Instructions:
      Hide

      create a page resource with a content that show some filter action (for instance a word from the censor badwords list but the word censoship must be activated and remember administrators can see badwords)
      verify the badword is correctly filtered
      Disable the Word censorship filter at resource level
      The filter is still active
      After correction the filter is correctly deactivated

      Show
      create a page resource with a content that show some filter action (for instance a word from the censor badwords list but the word censoship must be activated and remember administrators can see badwords) verify the badword is correctly filtered Disable the Word censorship filter at resource level The filter is still active After correction the filter is correctly deactivated
    • Workaround:
      Hide

      replace lines with
      $formatoptions = new stdClass;
      $formatoptions->noclean = true;
      $formatoptions->overflowdiv = true;
      $formatoptions->context = $context;
      $content = format_text($content, $page->contentformat, $formatoptions);

      Show
      replace lines with $formatoptions = new stdClass; $formatoptions->noclean = true; $formatoptions->overflowdiv = true; $formatoptions->context = $context; $content = format_text($content, $page->contentformat, $formatoptions);
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      17782

      Description

      See in mod/page/view.php lines 95-96
      $formatoptions = array('noclean'=>true, 'overflowdiv'=>true);
      $content = format_text($content, $page->contentformat, $formatoptions, $course->id);

        Issue Links

          Activity

          Hide
          Dan Poltawski added a comment -

          Thanks for the report and fix - I've submitted a pull request for this to be integrated.

          Show
          Dan Poltawski added a comment - Thanks for the report and fix - I've submitted a pull request for this to be integrated.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks! (20, 21 and master)

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (20, 21 and master)
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Tested under 20_STABLE (others are 100% same patch). Works as expected with filters being enabled / disabled properly.

          Show
          Eloy Lafuente (stronk7) added a comment - Tested under 20_STABLE (others are 100% same patch). Works as expected with filters being enabled / disabled properly.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Moodle's git/cvs repositories have been updated with this piece of art! Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: