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] Fixed "Warning: Attempt to read property "value" on string"#54851

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

@michaljusiega
Copy link
Contributor

@michaljusiegamichaljusiega commentedMay 6, 2024
edited
Loading

QA
Branch?7.1 (7.1.0-BETA1)
Bug fix?yes
New feature?no
Deprecations?no
IssuesFixed regresion of#53160
LicenseMIT

Hi! I've updated my project to7.1.0-BETA1 and I found an error.

After update I got:Warning: Attempt to read property "value" on string invendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:748 because in733 line the enum-case of valueTypeIdentifier has been already readed.

obraz

Quite not sure if tests are possible here.

@carsonbot
Copy link

Hey!

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

Cheers!

Carsonbot

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

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

Can we cover this change with a test to prevent future regressions?

@michaljusiega
Copy link
ContributorAuthor

Can we cover this change with a test to prevent future regressions?

I'll try tomorrow.

xabbuh reacted with heart emoji

@michaljusiega
Copy link
ContributorAuthor

This is a reproduce code at the moment:

class AbstractObjectNormalizerTest extends KernelTestCase{    public function testDenormalizeNestedValues()    {        $normalizer = self::getContainer()->get(NormalizerInterface::class); // service        $normalizer->denormalize(['values' => [['1'], ['2'], ['3'], ['4'], ['5']]], TypeClassReproducer::class);    }}class TypeClassReproducer{    /**     * @param array<int, array<int, string>>|null $values     */    public function __construct(        private readonly array|null $values = null,    ) {    }    /** @return array<int, array<int, string>>|null */    public function getValues(): array|null    {        return $this->values;    }}

@michaljusiega
Copy link
ContributorAuthor

michaljusiega commentedMay 7, 2024
edited
Loading

@xabbuh I gave up. Could you help me ?

@xabbuhxabbuhforce-pushed thebugfix-attempt-read-on-value-from-enum branch from58fccef toeda1dfcCompareMay 17, 2024 07:16
@xabbuh
Copy link
Member

thanks for the snippet, I was able to create a test based on it 👍

michaljusiega reacted with thumbs up emoji

@xabbuhxabbuhforce-pushed thebugfix-attempt-read-on-value-from-enum branch fromeda1dfc to975d64cCompareMay 17, 2024 07:22
@xabbuhxabbuhforce-pushed thebugfix-attempt-read-on-value-from-enum branch from975d64c to90251c9CompareMay 17, 2024 07:24
@xabbuh
Copy link
Member

Thank you@michaljusiega.

@xabbuhxabbuh merged commitbb91614 intosymfony:7.1May 17, 2024
@michaljusiegamichaljusiega deleted the bugfix-attempt-read-on-value-from-enum branchMay 17, 2024 07:40
@michaljusiega
Copy link
ContributorAuthor

Thank you too@xabbuh !

@fabpotfabpot mentioned this pull requestMay 17, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

3 participants

@michaljusiega@carsonbot@xabbuh

[8]ページ先頭

©2009-2025 Movatter.jp