Skip to content

Commit

Permalink
fix: [audit-logs:eventIndex] Fixed pagination issue while viewing eve…
Browse files Browse the repository at this point in the history
…nt history

Fix #9726
  • Loading branch information
mokaddem committed May 14, 2024
1 parent 05d8947 commit d346b6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/Controller/AuditLogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,21 @@ public function admin_index()
$this->set('title_for_layout', __('Audit logs'));
}

public function eventIndex($eventId, $org = null)
public function eventIndex($eventId = null, $org = null)
{
$params = $this->IndexFilter->harvestParameters(['created', 'org', 'eventId']);
if (!empty($params['eventId'])) {
$eventId = $params['eventId'];
} else if (empty($eventId)) {
$eventId = -1;
}
$event = $this->AuditLog->Event->fetchSimpleEvent($this->Auth->user(), $eventId);
if (empty($event)) {
throw new NotFoundException('Invalid event.');
}
$this->paginate['conditions'] = $this->__createEventIndexConditions($event);
$this->set('passedArgsArray', ['eventId' => $eventId, 'org' => $org]);

$params = $this->IndexFilter->harvestParameters(['created', 'org']);
if ($org) {
$params['org'] = $org;
}
Expand Down

0 comments on commit d346b6c

Please sign in to comment.