Unverified Commit b9dac2d3 authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #11932 from colemanw/8

Core/8 - Fix fatal error on Print/Merge Document for cases
parents dad3d0b2 d94a02b4
......@@ -41,9 +41,10 @@ class CRM_Case_Form_Task extends CRM_Core_Form_Task {
static $entityShortname = 'case';
/**
* The array that holds all the case ids
* Deprecated copy of $_entityIds
*
* @var array
* @deprecated
*/
public $_caseIds;
......@@ -113,4 +114,13 @@ class CRM_Case_Form_Task extends CRM_Core_Form_Task {
}
}
/**
* @inheritDoc
*/
public function setContactIDs() {
$this->_contactIds = CRM_Core_DAO::getContactIDsFromComponent($this->_entityIds,
'civicrm_case_contact', 'case_id'
);
}
}
......@@ -86,7 +86,7 @@ class CRM_Case_Form_Task_PDF extends CRM_Case_Form_Task {
*/
public function listTokens() {
$tokens = CRM_Core_SelectValues::contactTokens();
foreach ($this->_caseIds as $key => $caseId) {
foreach ($this->_componentIds as $key => $caseId) {
$caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseId, 'case_type_id');
$tokens += CRM_Core_SelectValues::caseTokens($caseTypeId);
}
......
......@@ -1662,10 +1662,10 @@ FROM civicrm_domain
*
* @param $componentIDs
* @param string $tableName
*
* @param string $idField
* @return array
*/
public static function &getContactIDsFromComponent(&$componentIDs, $tableName) {
public static function getContactIDsFromComponent($componentIDs, $tableName, $idField = 'id') {
$contactIDs = array();
if (empty($componentIDs)) {
......@@ -1676,7 +1676,7 @@ FROM civicrm_domain
$query = "
SELECT contact_id
FROM $tableName
WHERE id IN ( $IDs )
WHERE $idField IN ( $IDs )
";
$dao = CRM_Core_DAO::executeQuery($query);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment