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 nullable int cannot be serialized#52885

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

Conversation

@nikophil
Copy link
Contributor

@nikophilnikophil commentedDec 4, 2023
edited by nicolas-grekas
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?no
LicenseMIT

Hello,

previous tothis PR such XML could be deserialized correctly, setting null in the value:

<?xml version="1.0" encoding="UTF-8"?><DummyNullableInt><value/></DummyNullableInt>
class DummyNullableInt{publicfunction__construct(publicint|null$value =null    )    {}}

but now it creates the following error:

Uninitialized string offset 0/home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:495/home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:630/home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:377/home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:246/home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:346

I looked for any issue or PR mentioning this problem, but couldn't find it. So here is a fix

ping@Jeroeny

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.1" but it seems your PR description refers to branch "6.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@nikophilnikophil changed the base branch from7.1 to6.4December 4, 2023 10:54
@xabbuhxabbuh modified the milestones:7.1,6.4Dec 4, 2023
@nikophilnikophilforce-pushed theserializer/fix-regression branch fromb407e62 toc3c55e8CompareDecember 4, 2023 10:56
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.

that's for 5.4 I suppose?
can you please rebase + retarget?

nikophil reacted with thumbs up emoji
@nikophilnikophilforce-pushed theserializer/fix-regression branch fromc3c55e8 to5d62deaCompareDecember 4, 2023 11:55
@nikophilnikophil changed the base branch from6.4 to5.4December 4, 2023 11:56
@nikophil
Copy link
ContributorAuthor

@nicolas-grekas done

the problem only occurs with nullable types properties, hence the@requires PHP 8 tag

@nicolas-grekasnicolas-grekas modified the milestones:6.4,5.4Dec 4, 2023
@nicolas-grekasnicolas-grekas changed the title[Serializer] fix regression in 6.4 where nullable int cannot be serialized[Serializer] fix nullable int cannot be serializedDec 4, 2023
@nicolas-grekas
Copy link
Member

Thank you@nikophil.

nikophil reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commita0b3913 intosymfony:5.4Dec 4, 2023
This was referencedDec 30, 2023
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

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@nikophil@carsonbot@nicolas-grekas@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp