Skip to content

Conversation

@Geekimo
Copy link

@Geekimo Geekimo commented Nov 9, 2025

Q A
Branch? 4.2
Tickets Closes #7469
License MIT

Fixes a bug where link resources using the new ReadLinkParameterProvider fail to generate an IRI when using Hydra.

@Geekimo Geekimo force-pushed the fix/collection-id-with-link-parameter-provider-resources branch from e74e08d to 2552e3a Compare November 9, 2025 20:22
{
$identifiers = $context['uri_variables'] ?? [];

foreach ($identifiers as $identifier) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, resources loaded with the ReadLinkParameterProvider are still objects, so we need to replace them with their identifier's value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should never reach this path with non scalar identifiers, this is a highly costly path in API Platform imo its inside the identifiers extractor that we should handle this.

Copy link
Author

@Geekimo Geekimo Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soyuka In the getIdentifiersFromItem method, called at line 197 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, I need to take a look not sure what's happening.

@Geekimo Geekimo force-pushed the fix/collection-id-with-link-parameter-provider-resources branch 2 times, most recently from c4fd527 to 5b35943 Compare November 9, 2025 20:26
@soyuka soyuka force-pushed the fix/collection-id-with-link-parameter-provider-resources branch 6 times, most recently from 5b63fe0 to 4437642 Compare December 11, 2025 16:35
@soyuka soyuka force-pushed the fix/collection-id-with-link-parameter-provider-resources branch from 4437642 to 91847ab Compare December 11, 2025 16:36
@soyuka soyuka merged commit d7bab4b into api-platform:4.2 Dec 11, 2025
128 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants