Skip to content

Commit

Permalink
[FIX] Categories blog issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxenceCauderlier committed May 19, 2024
1 parent aa4cae7 commit dd8b8b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/blog/controllers/BlogListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function home($currentPage = 1)
return $response;
}

public function category($id, $name, $currentPage = 1)
public function category($name,$id, $currentPage = 1)
{
$categoriesManager = new BlogCategoriesManager();
$category = $categoriesManager->getCategory($id);
Expand Down Expand Up @@ -135,7 +135,7 @@ public function category($id, $name, $currentPage = 1)
if ($mode === 'list') {
$nbPages = ceil($nbNews / $newsByPage);
if ($currentPage > $nbPages) {
return $this->category($id, $name, 1);
return $this->category($name,$id, 1);
}
if ($nbPages > 1) {
$pagination = [];
Expand Down Expand Up @@ -183,6 +183,6 @@ public function page(int $page)
public function categoryPage(int $id, string $name, int $page)
{
$page = $page > 1 ? $page : 1;
return $this->category($id, $name, $page);
return $this->category($name,$id, $page);
}
}

0 comments on commit dd8b8b6

Please sign in to comment.