-
-
Notifications
You must be signed in to change notification settings - Fork 932
Fix identifiers behavior bugs #552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix identifiers behavior bugs #552
Conversation
soyuka
commented
May 25, 2016
Q | A |
---|---|
Bug fix? | yes |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #551 |
License | MIT |
Doc PR | ∅ |
#550 ref (sorry about multiple PR, github was buggy). |
|
||
return array_map(function ($identifierName, $identifierValue) { | ||
return sprintf('%s=%s', $identifierName, $this->generateIdentifiersUrl($identifierValue)); | ||
}, array_keys($identifiers), $identifiers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fond of this, does anyone have a better idea in mind?
Can you explain what's going on here? What did you mean when you said:
I don't see how that can be the case from the code before #533 - core/src/Bridge/Symfony/Routing/IriConverter.php Lines 72 to 90 in 037fece
We never checked for relations when getting identifier values. |
Anyway, for fixing this, why don't we just get the |
😕 I can't say why it was working before, anyway maybe it wasn't at least it's now tested. That's exactly what I did here |
Your current method allows for recursion of more than 1 level. I'm not sure how we're going to actually make that work... For the case of related entity used as an identifier, we can only allow non-composite identifier which is not a relation. |
I can try to remove recursion, I like recursion too much I think 😜.
Sorry I didn't understood. Isn't this enough? It lets the user choose if the identifier should be serialized or not, according to normalization groups. Recursion removed, thx @teohhanhui it's better now. |
d387d91
to
1e22702
Compare
It has nothing to do with serialization. We're talking about the URL here... |
Sorry, though you were talking about the second commit. I rewrote 3bf5323, should be better now. |
👍 |
ping @api-platform/core lgtm |
} | ||
} | ||
|
||
if (0 === count($identifiers[$propertyName])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer empty
(for performance).
1e22702
to
69fe23d
Compare
69fe23d
to
96fd131
Compare
I can squash my commits but I think they are best separated, let me know. |
Thanks @soyuka! |
…tifiers Fix identifiers behavior bugs