Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[serializer] prevent mixup in normalizer of the object to populate#30977

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromdbu:avoid-object-to-populate-mixup
Apr 8, 2019

Conversation

@dbu
Copy link
Contributor

@dbudbu commentedApr 7, 2019

EUFOSSA

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

OBJECT_TO_POPULATE is meant to specify the top level object. The implementation left the option in the context and it would be used whenever we have the first element that matches the class.#30607 (to master) introduces the feature to also keep the instances of attributes to deeply populate an existing object tree. In both cases, we do not want the mix up to happen with what the current OBJECT_TO_POPULATE is.

return$object;
}
// clean up even if no match
unset($context[static::OBJECT_TO_POPULATE]);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

this means we keep silently ignoring a non-matching object_to_populate. should we instead throw an exception when object to populate is set in the options but does not match? it seems to me that it indicates a programmer error.

not sure about BC of throwing the exception though. its in some way a bugfix, but could break existing code when relying on the serializer silently ignoring the mistake.

Copy link
Member

Choose a reason for hiding this comment

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

I would not throw an exception in 3.4 for BC reason. We can keep the code as is in 3.4, generate a deprecation notice on master, and throw an exception in 5.0.

Simperfit reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

great plan! tell me when this is merged to master, then i do the deprecation pull request.

@fabpot
Copy link
Member

Thank you@dbu.

@fabpotfabpot merged commitfdb668e intosymfony:3.4Apr 8, 2019
fabpot added a commit that referenced this pull requestApr 8, 2019
…populate (dbu)This PR was merged into the 3.4 branch.Discussion----------[serializer] prevent mixup in normalizer of the object to populateEUFOSSA| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -OBJECT_TO_POPULATE is meant to specify the top level object. The implementation left the option in the context and it would be used whenever we have the first element that matches the class.#30607 (to master) introduces the feature to also keep the instances of attributes to deeply populate an existing object tree. In both cases, we do not want the mix up to happen with what the current OBJECT_TO_POPULATE is.Commits-------fdb668e prevent mixup of the object to populate
@dbudbu deleted the avoid-object-to-populate-mixup branchApril 8, 2019 07:39
This was referencedApr 16, 2019
fabpot added a commit that referenced this pull requestApr 27, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes#30888).Discussion----------[serializer] extract normalizer tests to traitseufossa| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | Relates to#30818| License       | MIT| Doc PR        | -As discussed with@joelwurtz, extract normalizer functionality tests into traits to ensure consistent behaviour of all normalizers.* [x] Rebase when#30977,#30950 and#30907 are merged to master **blocker*** [x] Clean up order of trait inclusion and methods in the tests* [x] Clean up fixture classes of the traits. I started having one class named the same as the trait, where possibleStuff that we should do eventually, but can also do in separate pull requests, after this one has been merged:* [ ] Extract all features that we can (the existing normalizer tests should more or less only have the legacy tests in them, all functionality should be in trait)* [ ] Run test coverage and increase coverage so that we cover all important features and all relevant error cases.Commits-------2b6ebea [serializer] extract normalizer tests to traits
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

+3 more reviewers

@jewome62jewome62jewome62 approved these changes

@SimperfitSimperfitSimperfit approved these changes

@maxheliasmaxheliasmaxhelias approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

8 participants

@dbu@fabpot@jewome62@Simperfit@maxhelias@nicolas-grekas@lsmith77@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp