Do not fail if multiple certificate issues (#304)

Fix another location of this problem.
This commit is contained in:
mwithheld 2019-08-26 11:15:18 -07:00 committed by Mark Nelson
parent a5eea57644
commit 8ba89c18ce

View file

@ -147,7 +147,7 @@ class element extends \mod_customcert\element {
$customcert = $DB->get_record('customcert', array('templateid' => $page->templateid), '*', MUST_EXIST); $customcert = $DB->get_record('customcert', array('templateid' => $page->templateid), '*', MUST_EXIST);
// Now we can get the issue for this user. // Now we can get the issue for this user.
$issue = $DB->get_record('customcert_issues', array('userid' => $user->id, 'customcertid' => $customcert->id), $issue = $DB->get_record('customcert_issues', array('userid' => $user->id, 'customcertid' => $customcert->id),
'*', MUST_EXIST); '*', IGNORE_MULTIPLE);
if ($dateitem == CUSTOMCERT_DATE_ISSUE) { if ($dateitem == CUSTOMCERT_DATE_ISSUE) {
$date = $issue->timecreated; $date = $issue->timecreated;