mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 22:45:54 +02:00
MDL-31876 questionlib: fix question_has_capability_on memory bloat
This commit is contained in:
parent
5bbf3cb72b
commit
fe0fbfae31
@ -1306,7 +1306,7 @@ function question_has_capability_on($question, $cap, $cachecat = -1) {
|
||||
static $categories = array();
|
||||
static $cachedcat = array();
|
||||
if ($cachecat != -1 && array_search($cachecat, $cachedcat) === false) {
|
||||
$questions += $DB->get_records('question', array('category' => $cachecat));
|
||||
$questions += $DB->get_records('question', array('category' => $cachecat), '', 'id,category,createdby');
|
||||
$cachedcat[] = $cachecat;
|
||||
}
|
||||
if (!is_object($question)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user