Skip to content

Commit f3d0192

Browse files
author
Thibaudeau Pierre
committed
Issue-#3293 - fix: changed "hydra:next" apparition condition (#3457]
1 parent 48fc5bb commit f3d0192

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Hydra/Serializer/PartialCollectionViewNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function normalize($object, $format = null, array $context = [])
113113
$data['hydra:view']['hydra:previous'] = IriHelper::createIri($parsed['parts'], $parsed['parameters'], $this->pageParameterName, $currentPage - 1.);
114114
}
115115

116-
if (null !== $lastPage && $currentPage !== $lastPage || null === $lastPage && $pageTotalItems >= $itemsPerPage) {
116+
if (null !== $lastPage && $currentPage < $lastPage || null === $lastPage && $pageTotalItems >= $itemsPerPage) {
117117
$data['hydra:view']['hydra:next'] = IriHelper::createIri($parsed['parts'], $parsed['parameters'], $this->pageParameterName, $currentPage + 1.);
118118
}
119119
}

0 commit comments

Comments
 (0)