Skip to content

Commit

Permalink
Fix certificate generation - refs #8339
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jul 14, 2016
1 parent 3a977c9 commit 4521e20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main/inc/lib/certificate.lib.php
Expand Up @@ -50,7 +50,7 @@ public function __construct($certificate_id = 0, $userId = 0)

$this->user_id = !empty($userId) ? $userId : api_get_user_id();

if (empty($certificate_id)) {
if (!empty($certificate_id)) {
$certificate = $this->get($certificate_id);
if (!empty($certificate) && is_array($certificate)) {
$this->certificate_data = $certificate;
Expand All @@ -76,7 +76,11 @@ public function __construct($certificate_id = 0, $userId = 0)
}

//Setting the qr and html variables
if (isset($certificate_id) && !empty($this->certification_user_path)) {
if (
isset($certificate_id) &&
!empty($this->certification_user_path) &&
isset($this->certificate_data['path_certificate'])
) {
$pathinfo = pathinfo($this->certificate_data['path_certificate']);
$this->html_file = $this->certification_user_path.basename($this->certificate_data['path_certificate']);
$this->qr_file = $this->certification_user_path.$pathinfo['filename'].'_qr.png';
Expand Down

0 comments on commit 4521e20

Please sign in to comment.