Security Overview Report crashes

Security Overview Report crashes

by Angel Simón -
Number of replies: 2

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+

Average of ratings: -
In reply to Angel Simón

Re: Security Overview Report crashes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

:capallow is a placeholder. It gets replace by the value (1) from the $params array.

In reply to Tim Hunt

Re: Security Overview Report crashes

by Angel Simón -

Hi, thanks for the reply. I've hardcoded the value :capallow with 1. And run that query in SQL Server and it tooks 15 minutes to get the result. Is this normal? I think the report is crashing due to the amount of time it takes to load.

Thanks.