Since templates are not working for a while, I embedded <A> tag with URL to my query to create URL's from query results. Works fine for admin user but for regular user Moodle replaces questionmark with %5B%5BQUESTIONMARK%5D%5D. So this brakes the link obviously. Does anyone hav an idea for a workaround or what capability do I have to add to the user's role so the Moodle doesn't replace the questionmark.
The query returns links to categories on which the user has Mentor role. It works perfectly for admins but Moodle break links for non-admin users. This is the query:
concat('<a href="%%WWWROOT%%/course/index.php?categoryid=',cc.id,'">',cc.name,'</a>') AS Category
FROM prefix_course_categories cc
INNER JOIN prefix_context cx ON cc.id = cx.instanceid
INNER JOIN prefix_role_assignments ra ON cx.id = ra.contextid
INNER JOIN prefix_role r ON ra.roleid = r.id
INNER JOIN prefix_user usr ON ra.userid = usr.id
Where r.name='Mentor' and usr.id='%%USERID%%'
ORDER BY cc.depth, cc.path, usr.lastname, usr.firstname, r.name, cc.name