Calendar view.php doesn't get put through format_text required for multilang language support

Calendar view.php doesn't get put through format_text required for multilang language support

by Michael Milette -
Number of replies: 3
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

In Moodle 2.5.1, although event descriptions appear to be filtered, event descriptions are not. As I am working on a multilingual site which leverages multilang without it my content from every language is included.

The solution is to change line 127 of /calendar/view.php, replacing:

echo $renderer->show_day($calendar);

...with...

echo format_text($renderer->show_day($calendar),array('trusted' => true,'noclean' => true, 'para' => false));

What do I need to do to get this change integrated into the core Moodle code?

Best regards,

     Michael

Average of ratings: -
In reply to Michael Milette

Re: Calendar view.php doesn't get put through format_text required for multilang language support

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

That was for the day events. The upcoming events also needs to be fixed. Line 144 of /calendar/view.php also needs to be updated. It is currently:

echo $renderer->show_upcoming_events($calendar, $lookahead, $maxevents);

To enable multilang language support, it should be replaced with:

echo format_text($renderer->show_upcoming_events($calendar, $lookahead, $maxevents),array('trusted' => true,'noclean' => true, 'para' => false));

 Best regards,

     Michael

In reply to Michael Milette

Re: Calendar view.php doesn't get put through format_text required for multilang language support

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Michael,

Thanks for pointing out an area which is missed by the multi-lang filter, and for suggesting a code solution. Please could you create an issue in the Moodle Tracker for it, then post the issue number in this discussion thread so others can vote, watch and comment on it.

In reply to Helen Foster

Re: Calendar view.php doesn't get put through format_text required for multilang language support

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks for the suggestion Helen. I've added the issue in Moodle Tracker:

https://tracker.moodle.org/browse/MDL-41257

Just re-read my original post. The description in Moodle Tracker should be clearer.

Best regards,

Michael Milette

Average of ratings: Useful (1)