Skip to content

Commit

Permalink
Merge pull request #134 from compucorp/FEMSSPRT-44-fix-activity-report
Browse files Browse the repository at this point in the history
FEMSSPRT-44: Fix Activity Report Problem on Loading
  • Loading branch information
lisandro-compucorp authored Jun 17, 2021
2 parents 3d393ac + 14a8511 commit 71e16ee
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CRM/PivotData/AbstractData.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ abstract class CRM_PivotData_AbstractData implements CRM_PivotData_DataInterface
/**
* Name of data group.
*
* @var string
* @var string
*/
protected $name = NULL;

Expand Down Expand Up @@ -364,7 +364,6 @@ protected function getPaginatedResults(array $apiParams, $offset = 0, $multiValu
$apiParams['options']['offset'] = $offset;
$entities = civicrm_api3($this->apiEntityName, 'get', $apiParams);
$formattedEntities = $this->formatResult($entities['values']);
$indexes = [];

unset($entities);

Expand All @@ -376,12 +375,9 @@ protected function getPaginatedResults(array $apiParams, $offset = 0, $multiValu
break;
}

$index = $split['info']['index'];
if (!in_array($index, array_keys($indexes))) {
if ($split['info']['index'] !== $index) {
$page = 0;
}
else {
$page = $indexes[$index];
$index = $split['info']['index'];
}

$result[] = new CRM_PivotData_DataPage($split['data'], $index, $page++, $split['info']['nextOffset'], $split['info']['multiValuesOffset']);
Expand All @@ -392,7 +388,6 @@ protected function getPaginatedResults(array $apiParams, $offset = 0, $multiValu

$offset = $split['info']['nextOffset'];
$multiValuesOffset = $split['info']['multiValuesOffset'];
$indexes[$index] = $page;
}

return $result;
Expand Down

0 comments on commit 71e16ee

Please sign in to comment.