Skip to content

Commit

Permalink
infotext bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stellargela authored and aczerzuh committed Dec 12, 2022
1 parent 65179b1 commit a976175
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1292,14 +1292,18 @@ function questionnaire_get_coursemodule_info($coursemodule) {
global $DB;

$dbparams = array('id'=>$coursemodule->instance);
$fields = 'id, course, name, opendate, closedate';
if (! $questionnaire = $DB->get_record('questionnaire', $dbparams, $fields)) {
if (! $questionnaire = $DB->get_record('questionnaire', $dbparams)) {
return false;
}

$result = new cached_cm_info();
$result->name = $questionnaire->name;

if ($coursemodule->showdescription) {
// Convert intro to html. Do not filter cached version, filters run at display time.
$result->content = format_module_intro('questionnaire', $questionnaire, $coursemodule->id, false);
}

// Populate some other values that can be used in calendar or on dashboard.
if ($questionnaire->opendate) {
$result->customdata['opendate'] = $questionnaire->opendate;
Expand Down

0 comments on commit a976175

Please sign in to comment.