diff --git a/src/components/com_tjcertificate/administrator/libraries/certificate.php b/src/components/com_tjcertificate/administrator/libraries/certificate.php index b01c09f1..d4fb1474 100644 --- a/src/components/com_tjcertificate/administrator/libraries/certificate.php +++ b/src/components/com_tjcertificate/administrator/libraries/certificate.php @@ -682,6 +682,12 @@ public function issueCertificate($replacements, $options) throw new Exception(Text::_('COM_TJCERTIFICATE_TEMPLATE_INVALID')); } + // Generate unique certificate id + $this->unique_certificate_id = $this->generateUniqueCertId($options); + + // Generate unique certificate id replacement + $replacements->certificate->cert_id = $this->unique_certificate_id; + // Generate certificate body $this->generated_body = $this->generateCertificateBody($template->body, $replacements); @@ -714,9 +720,6 @@ public function issueCertificate($replacements, $options) $this->expired_on = $db->getNullDate(); } - // Generate unique certficate id - start - $this->unique_certificate_id = $this->generateUniqueCertId($options); - // Save certificate $this->save();