Skip to content

Commit

Permalink
Merge pull request #16846 from jitendrapurohit/core-1664
Browse files Browse the repository at this point in the history
dev/core#1664 - Fix errors recorded in log message on Manage Case scr…
  • Loading branch information
seamuslee001 authored Mar 20, 2020
2 parents ae277ea + 1d15448 commit 6769b88
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions CRM/Activity/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function getCaseGlobalRelationships() {
// get the total row count
CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo, NULL, FALSE, TRUE, NULL, NULL);
// limit the rows
$relGlobal = CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo, $params['sortBy'], $showLinks = TRUE, FALSE, $params['offset'], $params['rp']);
$relGlobal = CRM_Case_BAO_Case::getGlobalContacts($globalGroupInfo, $params['sortBy'] ?? NULL, $showLinks = TRUE, FALSE, $params['offset'], $params['rp']);

$relationships = [];
// after sort we can update username fields to be a url
Expand Down Expand Up @@ -101,11 +101,14 @@ public static function getCaseClientRelationships() {
}

// sort clientRelationships array using jquery call params
foreach ($clientRelationships as $key => $row) {
$sortArray[$key] = $row[$params['_raw_values']['sort'][0]];
$sortArray = [];
if (!empty($params['_raw_values']['sort'])) {
foreach ($clientRelationships as $key => $row) {
$sortArray[$key] = $row[$params['_raw_values']['sort'][0]];
}
$sort_type = "SORT_" . strtoupper($params['_raw_values']['order'][0]);
array_multisort($sortArray, constant($sort_type), $clientRelationships);
}
$sort_type = "SORT_" . strtoupper($params['_raw_values']['order'][0]);
array_multisort($sortArray, constant($sort_type), $clientRelationships);

$relationships = [];
// after sort we can update username fields to be a url
Expand Down Expand Up @@ -181,11 +184,14 @@ public static function getCaseRoles() {
}

// sort clientRelationships array using jquery call params
foreach ($caseRelationships as $key => $row) {
$sortArray[$key] = $row[$params['_raw_values']['sort'][0]];
$sortArray = [];
if (!empty($params['_raw_values']['sort'])) {
foreach ($caseRelationships as $key => $row) {
$sortArray[$key] = $row[$params['_raw_values']['sort'][0]];
}
$sort_type = "SORT_" . strtoupper($params['_raw_values']['order'][0]);
array_multisort($sortArray, constant($sort_type), $caseRelationships);
}
$sort_type = "SORT_" . strtoupper($params['_raw_values']['order'][0]);
array_multisort($sortArray, constant($sort_type), $caseRelationships);

$relationships = [];

Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public static function getCases() {
$params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
$params += CRM_Core_Page_AJAX::validateParams($requiredParameters, $optionalParameters);

$allCases = (bool) $params['all'];
$allCases = !empty($params['all']);

$cases = CRM_Case_BAO_Case::getCases($allCases, $params);

Expand Down

0 comments on commit 6769b88

Please sign in to comment.