-
Bug
-
Resolution: Fixed
-
Major
-
2.0.3, 2.1, 2.2
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
MDL-28168-custommenu -
Moderate
-
This is one regression caused by MDL-27073.
To reproduce:
- Into any 2.0/2.1/master site enable the urtolink filter (active for MOODLE_FORMAT)
- Define one custom menu with full links, mine was, for example:
Switch to postgres|http://127.0.0.1/~stronk7/git?dbconfig=postgres
|
Switch to mssql|http://127.0.0.1/~stronk7/git?dbconfig=mssql
|
Switch to oracle|http://127.0.0.1/~stronk7/git?dbconfig=oracle
|
|
Debug config|http://127.0.0.1/~stronk7/git?debugconfig
|
(using db mysql, git branch MOODLE_21_STABLE, based on master)|
|
- Take a look to the custom menu generated, all the links are borked. The cause is the urltolink detecting those URLs (because we changed to format_text()) and putting them within <a> tags, completely breaking the process.
Note this affects every site using custom menus and having that filter enabled for the MOODLE_FORMAT.
Workarounds: Disable the filter or make it not to process MOODLE_FORMAT (but it's one of the logical formats to process).
Possible fixes:
1) Programatically enclose the links under <nolink> sections before calling format_text()
2) Change the format in the call from FORMAT_MOODLE to another less suitable to have that filter enabled (FORMAT_HTML?).
3) Change the the format_text() call to format_string(), set the urltolink filter to process only contents (not strings) and require to enable filterall.
My +1 goes to 1) above. Ciao