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

Deprecated use of format_text in Moodle core code

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: Future Dev
    • Fix Version/s: None
    • Component/s: General

      Description

      The 4th parameter to format_text ($courseid_do_not_use) is used in several places in core Moodle code. I would suggest to fix it for Moodle 2.4.
      Here are all the instances I've found outdated use in Moodle core 2.3dev (Build: 20120511):

      question/editlib.php
      1237: echo format_text($category->info, $category->infoformat, $formatoptions, $this->course->id);

      blocks/rss_client/block_rss_client.php
      253: $r.= format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);

      lib/filelib.php
      1927: $output = format_text($text, FORMAT_HTML, $options, $COURSE->id);
      1937: $output = '<pre>'. format_text($text, FORMAT_MOODLE, $options, $COURSE->id) .'</pre>';
      2069: $output = format_text($text, FORMAT_HTML, $options, $COURSE->id);
      2079: $output = '<pre>'. format_text($text, FORMAT_MOODLE, $options, $COURSE->id) .'</pre>';

      lib/weblib.php
      1399: return trim(format_text($intro, $activity->introformat, $options, null));

      mod/workshop/form/rubric/assessment_form.php
      95: format_text($definition, $definitionformat, null, $workshop->course->id), $levelid);
      161: format_text($definition, $definitionformat, null, $workshop->course->id), $levelid);

      mod/forum/lib.php
      2979: $formattedtext = format_text($post->message, $post->messageformat, $options, $course->id);
      3355: $postcontent = format_text(forum_shorten_post($post->message), $post->messageformat, $options, $course->id);
      3361: $postcontent = format_text($post->message, $post->messageformat, $options, $course->id);

      mod/forum/rsslib.php
      334: $item->description = format_text($message, $rec->postformat, $formatoptions, $forum->course);

      mod/forum/search.php
      266: format_text($post->message, $post->messageformat, $options, $course->id),

      mod/forum/locallib.php
      298: $formattedtext = format_text($post->message, $post->messageformat, $options, $this->get('course')->id);

      mod/glossary/rsslib.php
      104: $item->description = format_text($definition, $rec->entryformat, $formatoptions, $glossary->course);

      mod/feedback/item/textarea/lib.php
      211: echo format_text($item->name.$requiredmark, true, false, false);
      256: echo format_text($item->name . $requiredmark, true, false, false);
      290: echo format_text($item->name . $requiredmark, true, false, false);

      mod/feedback/item/info/lib.php
      244: echo format_text($item->name.$requiredmark, true, false, false);
      320: echo format_text($item->name.$requiredmark, true, false, false);
      352: echo format_text($item->name . $requiredmark, true, false, false);

      mod/feedback/item/textfield/lib.php
      199: echo format_text($item->name.$requiredmark, true, false, false);
      245: echo format_text($item->name.$requiredmark, true, false, false);
      279: echo format_text($item->name . $requiredmark, true, false, false);

      mod/feedback/item/captcha/lib.php
      142: echo format_text($item->name.$requiredmark, true, false, false);
      193: echo format_text($item->name.$requiredmark, true, false, false);
      268: echo format_text($item->name.$requiredmark, true, false, false);

      mod/feedback/item/numeric/lib.php
      257: echo format_text($item->name . $requiredmark, true, false, false);
      339: echo format_text($item->name . $requiredmark, true, false, false);
      405: echo format_text($item->name . $requiredmark, true, false, false);

      mod/feedback/item/multichoicerated/lib.php
      305: echo format_text($item->name.$requiredmark, true, false, false);
      353: echo format_text($item->name.$requiredmark, true, false, false);
      388: echo format_text($item->name . $requiredmark, true, false, false);

      mod/feedback/item/multichoice/lib.php
      320: echo format_text($item->name.$requiredmark, true, false, false);
      423: echo format_text($item->name.$requiredmark, true, false, false);
      514: echo format_text($item->name . $requiredmark, true, false, false);

      mod/chat/lib.php
      808: $text = format_text($text, FORMAT_MOODLE, $options, $courseid);
      968: $text = format_text($text, FORMAT_MOODLE, $options, $courseid);

      course/lib.php
      2556: echo highlight($highlightterms, format_text($course->summary, $course->summaryformat, $options, $course->id));

      course/info.php
      57: echo format_text($course->summary, $course->summaryformat, array('overflowdiv'=>true), $course->id);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              tmuras Tomasz Muras
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: