Skip to content

Commit

Permalink
Merge pull request #2717 from desmax/subresource-pagination-fix
Browse files Browse the repository at this point in the history
Fix PartialCollectionViewNormalizer for subresources
  • Loading branch information
soyuka authored Apr 9, 2019
2 parents 90f422f + 9c14a78 commit bc0806b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Hydra/Serializer/PartialCollectionViewNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function normalize($object, $format = null, array $context = [])
}

$metadata = isset($context['resource_class']) && null !== $this->resourceMetadataFactory ? $this->resourceMetadataFactory->create($context['resource_class']) : null;
$isPaginatedWithCursor = $paginated && null !== $metadata && null !== $cursorPaginationAttribute = $metadata->getCollectionOperationAttribute($context['collection_operation_name'], 'pagination_via_cursor', null, true);
$isPaginatedWithCursor = $paginated && null !== $metadata && null !== $cursorPaginationAttribute = $metadata->getCollectionOperationAttribute($context['collection_operation_name'] ?? $context['subresource_operation_name'], 'pagination_via_cursor', null, true);

$data['hydra:view'] = [
'@id' => IriHelper::createIri($parsed['parts'], $parsed['parameters'], $this->pageParameterName, $paginated && !$isPaginatedWithCursor ? $currentPage : null),
Expand Down

0 comments on commit bc0806b

Please sign in to comment.