Skip to content

Commit

Permalink
[BUGFIX] Allow pagination with filter values
Browse files Browse the repository at this point in the history
  • Loading branch information
IchHabRecht authored and mschwemer committed Mar 7, 2025
1 parent 8f5e74a commit 2c49b53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function listAction(): ResponseInterface
$formUids = $this->mailRepository->findGroupedFormUidsToGivenPageUid((int)$this->id);
$mails = $this->mailRepository->findAllInPid((int)$this->id, $this->settings, $this->piVars);

$currentPage = (int)($this->request->getQueryParams()['currentPage'] ?? 1);
$currentPage = (int)($this->request->getParsedBody()['currentPage'] ?? $this->request->getQueryParams()['currentPage'] ?? 1);
$currentPage = $currentPage > 0 ? $currentPage : 1;

$itemsPerPage = (int)($this->settings['perPage'] ?? 10);
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Build/JavaScript/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function PowermailBackend($, Modal) {
* @private
*/
let addPageBrowseParamsListener = function () {
let paginationItems = document.querySelectorAll('.powermail_list .pagination a');
let paginationItems = document.querySelectorAll('.powermail_list ._pagination a');
paginationItems.forEach(function(item) {
item.addEventListener('click', function(event) {
event.preventDefault();
Expand All @@ -116,7 +116,7 @@ function PowermailBackend($, Modal) {
const form = document.querySelector('#powermail_module_search');
const paginationHiddenField = document.createElement('input');
paginationHiddenField.setAttribute('type', 'hidden');
paginationHiddenField.setAttribute('name', 'tx_powermail_web_powermailm1[currentPage]');
paginationHiddenField.setAttribute('name', 'currentPage');
paginationHiddenField.setAttribute('value', page.toString());
form.appendChild(paginationHiddenField);
form.submit();
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Powermail/Backend.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c49b53

Please sign in to comment.