In Moodle 1.9 we had courses link colors based on their categories. Each teacher could see his course with diferent colors and this helped them. We can't do this anymore, because HTML tags on course fullname on 2.3 prevent course to be imported. There's a fix for this from this thread:
https://moodle.org/mod/forum/discuss.php?d=218603#p951855
vi course/edit_form.php and find lines
$mform->addElement('text','fullname', get_string('fullnamecourse'),'maxlength="254" size="50"');
|
$mform->addHelpButton('fullname', 'fullnamecourse');
|
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
|
$mform->setType('fullname', PARAM_TEXT);
|
Change the last line to
$mform->setType('fullname', PARAM_CLEANHTML);
|
and you can save the course and category names like before in moodle 1.9.
Moodle 1.9 was using PARAM_MULTILANG but for some reason this was changed to PARAM_TEXT. In moodle 2 PARAM_CLEANHTML is defined in lib/moodlelib.php with
case PARAM_CLEANHTML: // clean html fragment
|
$param = fix_utf8($param);
|
$param = clean_text($param, FORMAT_HTML); // Sweep for scripts, etc
|
return trim($param);
|
and you could also use a longer version like in activities with
if (!empty($CFG->formatstringstriptags)) {
|
$mform->setType('fullname', PARAM_TEXT);
|
} else {
|
$mform->setType('fullname', PARAM_CLEANHTML);
|
}
|
(that would check if formatstringstriptags is set in administration menu and choose the PARAM_X according to selection)
OBS.: Is there another way to do this(more elegant way)? Could be a fix for this in a next release?
- is a regression caused by
-
MDL-32945 Deprecated PARAM_MULTILANG should be replaced with PARAM_TEXT
-
- Closed
-