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

[DoctrineBridge] Fix invalid guess with enumType#45012

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
nicolas-grekas merged 1 commit intosymfony:4.4fromjderusse:doctrine-enumType
Jan 14, 2022

Conversation

@jderusse
Copy link
Member

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Sincedoctrine/orm#9304 doctrine allows Enums with the newenumType option.
ie.

#[ORM\Column(type:'string', enumType: Status::class, length:1)]public Status$status;

The issue is, it break validations at several places:

  • doctrinerExtractor guess it's astring (Because oftype = string), and validation adds the constraintAssert\Type(string)
  • doctrineLoader guess it's a string with a maxLength and validation adds a constrainAssert\Length(max=1)

derrabus reacted with rocket emoji
@carsonbotcarsonbot added this to the4.4 milestoneJan 13, 2022
@carsonbotcarsonbot changed the titleFix invalid guess with enumType[DoctrineBridge] Fix invalid guess with enumTypeJan 13, 2022
@jonag
Copy link

I was playing with the last version of Doctrine this afternoon and ran into this exact issue. This also prevent the Serializer to correctly denormalize an object which one of its property is an enum.

I was looking for a way to fix this but you were faster. Anyway, I tried your patch and it works like a charm, thank you 👌 !

@nicolas-grekas
Copy link
Member

Thank you@jderusse.

@nicolas-grekasnicolas-grekas merged commit3974dc1 intosymfony:4.4Jan 14, 2022
@derrabus
Copy link
Member

Thank you! 🙂

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@jderusse@jonag@nicolas-grekas@derrabus@stof@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp