Skip to content

Commit

Permalink
prevent components caching between different subresources
Browse files Browse the repository at this point in the history
  • Loading branch information
usu committed Apr 14, 2024
1 parent 94ea001 commit 903ff1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Hal/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ private function getComponents(object $object, ?string $format, array $context):

$relation['iri'] = $this->iriConverter->getIriFromResource($object, UrlGeneratorInterface::ABS_PATH, $operation, $childContext);
$relation['operation'] = $operation;
$cacheKey = null;
}

if ($propertyMetadata->isReadableLink()) {
Expand All @@ -202,7 +203,7 @@ private function getComponents(object $object, ?string $format, array $context):
}
}

if (false !== $context['cache_key']) {
if ($cacheKey && false !== $context['cache_key']) {
$this->componentsCache[$cacheKey] = $components;
}

Expand Down

0 comments on commit 903ff1e

Please sign in to comment.