andrewnicols / moodle-local_usertours

asdf
GNU General Public License v3.0
6 stars 7 forks source link

Filtered content in step titles causes tours to fail #35

Open dkleto opened 7 years ago

dkleto commented 7 years ago

Depending on which filter plugins are enabled, using some specific content in step titles can prevent a tour from loading. The cause of this seems to be that bootstrap-tour expects the title field to be plain text rather than HTML, which causes it to fail when Moodle filters add HTML tags to a step title.

Steps to reproduce (with most recent version of the plugin on Moodle 3.1.7):

dkleto commented 7 years ago

The simplest solution that I found for this was formatting the title as a plain string rather than HTML, but this would negate the fix for multi-lang filters mentioned in Issue #11. The alternative that I've come up with is to use external_format_text to apply filters including multi-lang, then strip the HTML tags out using external_format_string before the title is passed to bootstrap-tour. This is a bit untidy but seems to do the job.

dkleto commented 7 years ago

Looks like the newer version of user tours which has been merged into 3.3 core doesn't suffer from this issue because it uses flexitour rather than bootstrap-tour.