Internal: Migration: Fix undefined variable cat_id - refs BT#21007

pull/5119/head
christianbeeznst 2 years ago
parent c34412ebff
commit de99429f80
  1. 3
      public/main/inc/lib/certificate.lib.php
  2. 2
      public/main/my_space/myStudents.php

@ -101,7 +101,8 @@ class Certificate extends Model
//$this->checkCertificatePath();
if ('true' === api_get_setting('document.allow_general_certificate')) {
// General certificate
$name = hash('sha256', $this->user_id . $this->certificate_data['cat_id']);
$categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;
$name = hash('sha256', $this->user_id . $categoryId);
$fileName = $name . '.html';
$content = $this->generateCustomCertificate();
$gradebookCertificateRepo = Container::getGradeBookCertificateRepository();

@ -549,7 +549,7 @@ switch ($action) {
case 'generate_certificate':
$gradebookCertificateRepo = Container::getGradeBookCertificateRepository();
$gradebookCertificateRepo->deleteCertificateAndRelatedFiles($studentId, 0);
$certificate = new Certificate(83, $studentId);
$certificate = new Certificate(0, $studentId);
$certificate->generatePdfFromCustomCertificate();
exit;
case 'send_legal':

Loading…
Cancel
Save