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] Fix serialization of items with groups across entities and discrimination map#27826

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

Conversation

sroze
Copy link
Contributor

@srozesroze commentedJul 3, 2018
edited
Loading

QA
Branch?4.1
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#27816,#27641
LicenseMIT
Doc PRø

I believe this approach is better than the one taken in#27816. At least, it's an alternative :)

@sroze
Copy link
ContributorAuthor

Test failures are un-related.

@voodoo-dn
Copy link

This PR works well and fix my problem, thanks.

@voodoo-dnvoodoo-dn mentioned this pull requestJul 3, 2018
Closed
@@ -142,11 +142,16 @@ protected function getAllowedAttributes($classOrObject, array $context, $attribu
return false;
}

if (null !== $this->classDiscriminatorResolver && null !== $discriminatorMapping = $this->classDiscriminatorResolver->getMappingForMappedObject($classOrObject)) {
$allowedAttributes[] = $attributesAsString ? $discriminatorMapping->getTypeProperty() : new AttributeMetadata($discriminatorMapping->getTypeProperty());
$class = is_object($classOrObject) ? \get_class($classOrObject) : $classOrObject;
Copy link
Member

Choose a reason for hiding this comment

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

is_object should be fully-qualified here, to benefit from the optimized opcode.

Copy link
Member

Choose a reason for hiding this comment

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

btw, shouldn't it go inside theif (null !== $this->classDiscriminatorResolver) { ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good points, updated 👍

@srozesrozeforce-pushed thefix-serializer-with-groups-across-entities branch from65e0370 toc648b93CompareJuly 3, 2018 15:02
@nicolas-grekasnicolas-grekas added this to the4.1 milestoneJul 3, 2018
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(failures unrelated)
(sure we don't need more tests?)

@sroze
Copy link
ContributorAuthor

@nicolas-grekas the fixture update covers the use-cases I think about so I'd say no 🤔

@nicolas-grekas
Copy link
Member

Thank you@sroze.

@nicolas-grekasnicolas-grekas merged commitc648b93 intosymfony:4.1Jul 9, 2018
nicolas-grekas added a commit that referenced this pull requestJul 9, 2018
… entities and discrimination map (sroze)This PR was merged into the 4.1 branch.Discussion----------[Serializer] Fix serialization of items with groups across entities and discrimination map| Q             | A| ------------- | ---| Branch?       | 4.1| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27816,#27641| License       | MIT| Doc PR        | øI believe this approach is better than the one taken in#27816. At least, it's an alternative :)Commits-------c648b93 Fix serialization of abstract items with groups across multiple entities
@fabpotfabpot mentioned this pull requestJul 23, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@dunglasdunglasdunglas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
4.1
Development

Successfully merging this pull request may close these issues.

6 participants
@sroze@voodoo-dn@nicolas-grekas@dunglas@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp