Skip to content

Commit

Permalink
Merge pull request #12 from NicolasBarbey/main
Browse files Browse the repository at this point in the history
fix pagination
  • Loading branch information
NicolasBarbey authored Oct 1, 2024
2 parents 1c56f04 + f7d45fe commit 4073497
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.1.7</version>
<version>2.1.8</version>
<authors>
<author>
<name>Gilles Bourgeat</name>
Expand Down
5 changes: 1 addition & 4 deletions EventListener/CanonicalUrlListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ public function generateUrlCanonical(CanonicalUrlEvent $event): void
$canonicalUrl = rtrim($canonicalUrl, '/');
$view = $request->get("_view");

if(in_array($view, ['category', 'folder'])) {
if (null === $page = $request->get('page')){
$page = 1;
}
if((null !== $page = $request->get('page')) && in_array($view, ['category', 'folder'])) {

$canonicalUrl .= '?page='.$page;
}
Expand Down

0 comments on commit 4073497

Please sign in to comment.