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

Create common function for handling mod->name format

XMLWordPrintable

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

      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

            moodle.com Moodle HQ
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.