Permalink
Browse files

MDL-31876 questionlib: fix question_has_capability_on memory bloat

  • Loading branch information...
1 parent 5bbf3cb commit fe0fbfae315b00199b8360d9a02ccda10d2536b3 @dhg-atarplpl dhg-atarplpl committed Mar 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/questionlib.php
View
2 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)) {

0 comments on commit fe0fbfa

Please sign in to comment.