From 4521e20f835c69dafb2c3eefb383ec6b008dab98 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 14 Jul 2016 14:05:36 -0500 Subject: [PATCH] Fix certificate generation - refs #8339 --- main/inc/lib/certificate.lib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/certificate.lib.php b/main/inc/lib/certificate.lib.php index 9110f0ee3b5..baf2e0644d8 100755 --- a/main/inc/lib/certificate.lib.php +++ b/main/inc/lib/certificate.lib.php @@ -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; @@ -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';