MDL-31876 questionlib: fix question_has_capability_on memory bloat

This commit is contained in:
Gootvilig David Hai 2012-03-05 14:38:13 +02:00
parent 5bbf3cb72b
commit fe0fbfae31

View File

@ -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)) {