Skip to content

Commit 265e783

Browse files
committed
[BUGFIX] Respect pagination setting in ModuleController
It is possible to set the maximum number of items for the pagination in the ModuleController. This value was not respected, while initializing the pagination. Related: #1404 (cherry picked from commit e5fe598a6cdfe6c9c418658b3d373ab1101bf86e)
1 parent 46de016 commit 265e783

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎Classes/Controller/ModuleController.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function listAction(): ResponseInterface
103103

104104
$itemsPerPage = (int)($this->settings['perPage'] ?? 10);
105105
$paginator = GeneralUtility::makeInstance(QueryResultPaginator::class, $mails, $currentPage, $itemsPerPage);
106-
$pagination = GeneralUtility::makeInstance(SlidingWindowPagination::class, $paginator, 15);
106+
$pagination = GeneralUtility::makeInstance(SlidingWindowPagination::class, $paginator, $itemsPerPage);
107107

108108
$firstFormUid = StringUtility::conditionalVariable($this->piVars['filter']['form'] ?? '', key($formUids));
109109
$beUser = BackendUtility::getBackendUserAuthentication();
@@ -119,7 +119,7 @@ public function listAction(): ResponseInterface
119119
'paginator' => $paginator,
120120
],
121121
'settings' => $this->settings,
122-
'perPage' => $this->settings['perPage'] ?? 10,
122+
'perPage' => $itemsPerPage,
123123
'writeAccess' => $beUser->check('tables_modify', Answer::TABLE_NAME)
124124
&& $beUser->check('tables_modify', Mail::TABLE_NAME),
125125
'activateXlsxExport' => $this->isPhpSpreadsheetInstalled,

‎Configuration/TypoScript/Main/Configuration/02_Settings.typoscript‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ module.tx_powermail.settings {
5757
# Don't touch this (this is just to let the extension know, that there is TypoScript included)
5858
staticTemplate = 1
5959
}
60+
perPage = 10
6061
uploadPath = {$plugin.tx_powermail.settings.misc.uploadFolder}
6162
}

0 commit comments

Comments
 (0)