Skip to content
Snippets Groups Projects
Verified Commit b22cbbe1 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Release version 5.2.1

parent fa8b5dc5
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ class Pagination { ...@@ -86,7 +86,7 @@ class Pagination {
public function initialize() { public function initialize() {
$this->firstPage = 1; $this->firstPage = 1;
$this->totalItems = $this->fetchTotalItemCount(); $this->totalItems = $this->fetchTotalItemCount();
$this->lastPage = ceil($this->totalItems / $this->limit); $this->lastPage = (int) ceil($this->totalItems / $this->limit);
// correct current page if out of bounds // correct current page if out of bounds
$this->currentPage = $this->currentPage < 1 ? 1 : min($this->currentPage, $this->lastPage); $this->currentPage = $this->currentPage < 1 ? 1 : min($this->currentPage, $this->lastPage);
$this->nextPage = $this->currentPage >= $this->lastPage ? $this->lastPage : $this->currentPage + 1; $this->nextPage = $this->currentPage >= $this->lastPage ? $this->lastPage : $this->currentPage + 1;
...@@ -110,8 +110,7 @@ class Pagination { ...@@ -110,8 +110,7 @@ class Pagination {
private function fetchTotalItemCount(): int { private function fetchTotalItemCount(): int {
$query = clone $this->queryResult->getQuery(); $query = clone $this->queryResult->getQuery();
$query->setOffset(0)->setLimit(9999999); $query->setOffset(0)->setLimit(9999999);
$count = $query->execute()->count(); return $query->execute()->count();
return $count ?? 0;
} }
/** /**
...@@ -124,8 +123,7 @@ class Pagination { ...@@ -124,8 +123,7 @@ class Pagination {
private function fetchItems(): array { private function fetchItems(): array {
$query = clone $this->queryResult->getQuery(); $query = clone $this->queryResult->getQuery();
$query->setOffset($this->startItem - 1)->setLimit($this->limit); $query->setOffset($this->startItem - 1)->setLimit($this->limit);
$items = $query->execute(TRUE); return $query->execute(TRUE);
return $items ?? [];
} }
/** /**
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"license": [ "license": [
"GPL-2.0-or-later" "GPL-2.0-or-later"
], ],
"version": "5.2.0", "version": "5.2.1",
"support": { "support": {
"issues": "https://gitlab.sgalinski.de/typo3/sg_jobs" "issues": "https://gitlab.sgalinski.de/typo3/sg_jobs"
}, },
......
...@@ -4,7 +4,7 @@ $EM_CONF['sg_jobs'] = [ ...@@ -4,7 +4,7 @@ $EM_CONF['sg_jobs'] = [
'title' => 'Jobs', 'title' => 'Jobs',
'description' => 'Manage and display your Job offers.', 'description' => 'Manage and display your Job offers.',
'category' => 'plugin', 'category' => 'plugin',
'version' => '5.2.0', 'version' => '5.2.1',
'state' => 'stable', 'state' => 'stable',
'uploadfolder' => FALSE, 'uploadfolder' => FALSE,
'createDirs' => '', 'createDirs' => '',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment