dbnschools / moodle-theme_fordson

Theme for Moodle 3.3+
43 stars 40 forks source link

Single quote in text causes bug #31

Closed Edunao closed 6 years ago

Edunao commented 6 years ago

Hi Chris,

We have an issue while using Marketing Tiles with theme fordson. Adding a marketing tiles with a text containing single quotes in a link causes the plugin to bug.

image 3 image 2

Best regards Edunao's team

dbnschools commented 6 years ago

Can you post exactly what you tried to enter for the button area. I think you are trying to make the link open in a new window and it will not work. Remove the code and just put an actual link like http://dearbornschools.org

Edunao commented 6 years ago

I was not trying to open the link in a new window. I was just trying to write "C'est parti !"

capture d ecran 2018-07-30 a 16 50 52

dbnschools commented 6 years ago

OK. I'll take a look.

dbnschools commented 6 years ago

OK. I found the issue. I was using format_text in the core_renderer.php file. If I switch this to format_string for the button text it fixes the issue. This will be a fix in the next release of Fordson.

Edunao commented 6 years ago

Hi, We have just tested the latest version for Moodle 3.3 and the issue is still present. Could you please tell me which line i need to change to resolve the problem. Many thanks in advance.

dbnschools commented 6 years ago

We are developing and working on Moodle 3.5. We aren't fixing the older versions as we only work on the versions we use.

This function was changed: https://github.com/dbnschools/moodle-theme_fordson/blob/master/classes/output/core_renderer.php#L548-L746

And this one: https://github.com/dbnschools/moodle-theme_fordson/blob/master/classes/output/core_renderer.php#L799-L888

To include format_string when processing the text. You might be able to just copy/paste those two functions into your core_renderer.php file.

Edunao commented 6 years ago

Understood, Many thanks