michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
30 stars 42 forks source link

Bug: Compatibility Issue with Stream Theme #268

Closed juanfortuna closed 9 months ago

juanfortuna commented 9 months ago

Prerequisites

What happened?

Hello, I am using Moodle 4.2 and I installed the Stream theme in its latest version. I also have the FilterCode plugin installed. In a carousel image of the main page, I want to add a link to another page with a user parameter, the city, but it doesn't work. I have tried everything but I can't get the parameter to pass, it doesn't recognize {city}, and the parameter doesn't load correctly. On other pages within Moodle I have not had problems. I appreciate the help you can give me.

What do you think should have happened?

I expected to click on the image at the frontpage and the configured link open other webpage in the same server, and the URL pass a user variable, City, like url?city={city}. I did it on a course page and works fine. I try to do it in the frontpage but didn't work.

Steps to reproduce

  1. Login as any user with different roles.
  2. Go to configure strem theme frontpage settings
  3. Click on LINK URL for the image on the slider
  4. See error or issue. When I click on image on the frontpage, the link don't show the variable=value correctly, value is {city}, instead of city name.

Screenshots

No response

Moodle version

Moodle 4.2.2+ build:20230818

Installed Moodle UI Language packs.

If other language(s), please specify

Spanish International

Workaround

No response

Additional information

No response

System information

Client Device type: (e.g. Desktop, iPhone or iPad, Android phone or tablet, Other - specify) Client Operating System: (e.g. Windows, Linux, Mac OS, Android, iOS, Other - specify) Client Web Browser: (e.g. Chrome, Edge, Firefox, Safari, Safe Exam Browser, Moodle Mobile App) Server Operating System: (e.g. Windows, Linux, Mac OS, Other - specify) Server Webserver: (e.g. Apache, Nginx, IIS, Other - specify) Server PHP: (e.g. 7.3, 7.4, 8.x, Other - specify)

Code of Conduct

michael-milette commented 9 months ago

Hi @juanfortuna ,

Thanks for taking the time to report this issue. However, since the {city} tag works elsewhere on your site, I am pretty sure that this is not an issue with FilterCodes but with the theme.

Stream is a great looking theme but, in this instance, it is outputing content without passing it through Moodle filters first.

My recommendation would be to contact Hugo, the developer of the Stream theme and ask him to kindly fix the issue by passing the output through the format_string() or format_text() functions. From what I can see, he is already familiar with FilterCodes so he will likely know what you are talking about. You can report the issue by going to:

https://github.com/hribeir0/moodle-theme_stream/issues

By the way, this issue doesn't just affect FilterCodes. It would also be a problem for those with sites that need to pass text through multi-language filters so I think it is important to get this fixed.

Hope you find this helpful.

Best regards,

Michael Milette

michael-milette commented 9 months ago

This developer of the Stream theme has been very responsive and quickly published a fix for this issue. See https://github.com/hribeir0/moodle-theme_stream/issues/2

Closing this ticket.