diff --git a/CRM/Civicase/Hook/BuildForm/HandleDraftActivities.php b/CRM/Civicase/Hook/BuildForm/HandleDraftActivities.php index 8205aeb8e..4dc8354e7 100644 --- a/CRM/Civicase/Hook/BuildForm/HandleDraftActivities.php +++ b/CRM/Civicase/Hook/BuildForm/HandleDraftActivities.php @@ -149,6 +149,10 @@ private function addSaveDraftButton(CRM_Core_Form &$form, $formName) { $form->setDefaults($draft); } } + $caseId = CRM_Utils_Request::retrieve('caseid', 'String'); + if ($formName === self::PDF_LETTER_FORM_NAME && !empty($caseId)) { + $form->addElement('hidden', 'caseid', $caseId); + } } /**