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

Create common function for handling mod->name format

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Do
    • 2.4.1
    • None
    • Forms Library, Libraries
    • MOODLE_24_STABLE

    Description

      All the mod forms have this piece of code:

      if (!empty($CFG->formatstringstriptags)) {
          $mform->setType('name', PARAM_TEXT);
      } else {
          $mform->setType('name', PARAM_CLEANHTML);
      }
      

      This is about to validate it's correct (see MDL-37908) and then move it to a common function somewhere (properly covered by tests, of course).

      At the same time, perhaps it would be a good idea to find other repeated pieces of code in those forms and unify more and more (surely another issue).

      Ciao

      Attachments

        Issue Links

          Activity

            People

              moodle.com Moodle HQ
              stronk7 Eloy Lafuente (stronk7)
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: