From 8d11716bfcf4aefaf1d02435ce090e985e54ee3a Mon Sep 17 00:00:00 2001 From: Gootvilig David Hai Date: Mon, 5 Mar 2012 14:38:13 +0200 Subject: [PATCH] MDL-31876 questionlib: fix question_has_capability_on memory bloat --- lib/questionlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/questionlib.php b/lib/questionlib.php index f9d82a14ce7..33f08904c27 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -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)) {