Pass submitdirections text in Hot Question settings through the format_text() function so filters are applied
jgramp opened this issue · 7 comments
In the Hot Question settings under Entries
the text entered in these fields are not passed through the format_text() function, so filters are not applied to this text. This means that this plugin is not fully compatible with the content translation filter, so we can't use this with languages other than English in our Moodle Academy courses, unless we leave this field blank (or add a space as it's a required field).
The fields that need to be passed through the format_text() function are:
- Submit your question here:
- Questions column label
- Priority column label
- Heat column label
- Approval required column label
- Remove column label
The format_text() function is described here:
https://docs.moodle.org/dev/Output_functions
This should be a simple to fix in the code.
Sorry to be so slow to reply, but I am sitting vigil with my wife who is in home hospice care, due to stage four pancreatic cancer. I will add this to my TODO list, but it could be a while as my development computer is on the other side of my house and has not bee turned on for weeks. If you can come up with the code changes and make a pull request, that would be the only way I might get to it any time soon.
Sadly, our vigil is over, but I do still have aftermath events to take care of. I will work on this as time permits.
Took a few minutes to look at this just now and only the first item, Submit your question here:, needs to have format_text added. Doing so makes it possible to personalize the submit directions using a Generico filter. e.g. AL, please submit our question here:. Even a Generico postit will work there now, in my development code.
All the others you list, just need to be changed to various, get_string, so they get the labels from the language file so if they have been translated, they show in the correct language.
Oops, spoke too soon. While explaining this to my son, I realized the column headings DO need to go through format_text so that the versatility of having multiple Hot Question activities with different column labels and submit wording is still maintained.
I'm so sorry to hear your sad news.
Yes, I think having format_text on each setting would be best, as these can be updated at any time through the user interface and the built in Moodle language support is more for language strings that stay static. We use a set of content translation plugins (https://moodle.org/plugins/filter_fulltranslate) for our translations, so having them pass through the standard Moodle translation process will not work in our use case.
I have created a Hot Question v4.0.1 that uses format_text for all the labels you have listed. I am in the process of testing on all the versions of Moodle, so it will take me a while to post the actual release on the Moodle download pages. I also really need to rebuild my Behat test server as it has died months ago while taking care of my wife. Could you please test it and let me know if it is working the way you need it to work?
Thank you. I'm testing it now.
That's exactly what we need. Tested on Moodle Workplace 3.11.3+ (Build: 20211004).
Thanks so much!