Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-28687_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit e9f8af2a1b56f9126fcf84576ee05527ddb6f377 2 parents 35dd038 + 3575052
Aparup Banerjee nebgor authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/questionlib.php
5 lib/questionlib.php
View
@@ -1343,6 +1343,11 @@ function question_has_capability_on($question, $cap, $cachecat = -1) {
}
$question = $questions[$question];
}
+ if (empty($question->category)) {
+ // This can happen when we have created a fake 'missingtype' question to
+ // take the place of a deleted question.
+ return false;
+ }
if (!isset($categories[$question->category])) {
if (!$categories[$question->category] = $DB->get_record('question_categories',
array('id'=>$question->category))) {
Please sign in to comment.
Something went wrong with that request. Please try again.