Skip to content

Commit 2f82499

Browse files
authored
fix(symfony,laravel): IriConverter local cache key collision between item and collection ops (#7975)
1 parent af2fca8 commit 2f82499

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Routing/IriConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getIriFromResource(object|string $resource, int $referenceType =
122122
$operation = $this->operationMetadataFactory->create($context['item_uri_template']);
123123
}
124124

125-
$localOperationCacheKey = ($operation?->getName() ?? '').$resourceClass.((\is_string($resource) || $operation instanceof CollectionOperationInterface) ? '_c' : '_i');
125+
$localOperationCacheKey = ($operation?->getName() ?? '').$resourceClass.(\is_string($resource) ? '_s' : '_o').($operation instanceof CollectionOperationInterface ? '_c' : '_i');
126126
if ($operation && isset($this->localOperationCache[$localOperationCacheKey])) {
127127
return $this->generateSymfonyRoute($resource, $referenceType, $this->localOperationCache[$localOperationCacheKey], $context, $this->localIdentifiersExtractorOperationCache[$localOperationCacheKey] ?? null);
128128
}

0 commit comments

Comments
 (0)