Details
Description
At line 1405 there were missing quotes arounf the {$context->id} variable: when it is empty it makes the query crash and the XML Parser throws an error...
$sql = "SELECT ctx.path, rc.roleid, rc.capability, rc.permission
FROM {$CFG->prefix}role_capabilities rc
JOIN {$CFG->prefix}context ctx
ON rc.contextid=ctx.id
WHERE (rc.roleid IN ($roleids)
==> AND (ctx.id='{$context->id}' OR ctx.path LIKE '{$context->path}/%'))
$wherelocalroles
ORDER BY ctx.depth ASC, ctx.path DESC, rc.roleid ASC ";
Issue Links
| This issue has a non-specific relationship to: | ||||
| MDL-11360 | Call to a member function on a non-object |
|
|
|
I'm pretty sure this is not an issue anymore, but assigning to Martin L to check.
The actual fix proposed here is not ideal, I think, because quotes around a number slow things down, and also because the SQL shouldn't even be called if there is no $context->id ..