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: course index filter for firstname shows person who updated text area not current logged in user #298

Closed MURBASLMS closed 1 month ago

MURBASLMS commented 1 month ago

Prerequisites

What happened?

hi, we noticed an issue with the course index and text & media elements in a course. we use boost_union (latest 410) but happens in boost.

testing seems to show that the filter shows the correct firstname in the course content but the name of the person who last edited the element with the filter in the course index.

Unit__MBS537_Strategic_Marketing_Management__t3__2023__copy_1___MyMurdoch_Learning

What do you think should have happened?

I expected the course index representation of the text and media element to show the correct filtered firstname

Steps to reproduce

in a course add a text and media element with welcome {firstname}, save open course index, names should appear correctly log in to different browser as someone else to edit the text and media element, refresh page observe course index in both browsers, different names appear in course index for both

Screenshots

No response

Moodle version

4.1.10+ (Build: 20240516)

Installed Moodle UI Language packs.

If other language(s), please specify

No response

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.4, 8.0, 8.1, 8.2, 8.3, Other - specify)

Code of Conduct

michael-milette commented 1 month ago

HI @MURBASLMS ,

Thank you for taking the time to report this issue.

While I did not test your issue out with Boost Union, I did test it out with Boost, Trema, Moove and Stream. The results were consistent. Labels (now called Text and Media) only appear when editing is turned on. When editing is turned off, this information does not appear in the course index. I could only reproduce the issue you described when the course editing is turned on.

If this happens in Boost Union for you with editing is turned off, I can only conclude that the theme may need to be fixed and updated. I recommend that you contact its maintainers to see what they can do about it.

Either way, this is not a FilterCodes issue. Filters are only applied when Moodle code calls the standard Output API functions, format_string and format_text.

I don't know for sure but I suspect that labels may now excluded from the course index sidebar because of problems like this.

Best regards,

Michael

MURBASLMS commented 1 month ago

thanks for taking the time to test. Yes i see boost doesn't show when not in editing mode, had to clear caches. For some reason boost union does show in view mode, so i'll see if they have any issues raised. So am i right in thinking that the filter is still behaving incorrectly for the course index (in boost and in edit mode)?

michael-milette commented 1 month ago

There seems to be a caching problem when edit mode is active, even with Boost. When not in edit mode, the caching issue does not appear because that type of activity is not included in the course index.

If this is important to you, you could create a ticket in the Moodle tracker at https://tracker.moodle.org and report the caching problem, indicating that it is not showing up correctly when edit mode it turned on. Suggest that the issue either be fixed or the activity not show up with edit mode turned on, just like when it is turned off.

Best regards,

Michael