Hello everyone, I'm having this problem when I try to access the Administration -> Security Overview section. When I click this section, it takes a lot to load a response and then i get:
Error reading from database
More information about this error
Debug info:
SELECT COUNT(DISTINCT u.id) FROM (SELECT rcx.*
FROM mdl_role_capabilities rcx
JOIN mdl_capabilities cap ON (cap.name = rcx.capability AND ((cap.riskbitmask) & (4)) <> 0)
WHERE rcx.permission = ?) rc,
mdl_context c,
mdl_context sc,
mdl_role_assignments ra,
mdl_user u
WHERE c.id = rc.contextid
AND (sc.path = c.path OR sc.path LIKE CAST(c.path AS NVARCHAR(255)) + CAST('/%' AS NVARCHAR(255)) OR c.path LIKE CAST(sc.path AS NVARCHAR(255)) + CAST('/%' AS NVARCHAR(255)) )
AND u.id = ra.userid AND u.deleted = 0
AND ra.contextid = sc.id AND ra.roleid = rc.roleid
[array (
0 => 1,
)]
Error code: dmlreadexception
The stack trace shows that the error is generated in:
line 112 of \report\security\index.php: call to report_security_check_riskxss()
I checked the code and I noticed that the SQL statement is trying to add a where clause with this condition
WHERE rcx.permission = :capallow
:capallow doesn't exists or it is not working.
Anyone had this error or has a clue of how to solve it?
Thanks in advance!
Moodle version: 2.6.2+