-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix using enums with the QueryBuilder #10058
Conversation
3fa2250
to
64349ae
Compare
64349ae
to
42cc9c7
Compare
42cc9c7
to
d69a0fa
Compare
Cc @michnovka |
Ill review this on Sunday and check how my PR caused this issue and confirm
this is a good fix. thx for waiting
…On Thu, Sep 22, 2022, 23:30 Jakub Janata ***@***.***> wrote:
***@***.**** approved this pull request.
—
Reply to this email directly, view it on GitHub
<#10058 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD6JI74VTUWDKYB63WCVXWLV7TFY3ANCNFSM6AAAAAAQTKHFBE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is a good fix, and I also believe we now cover all enum hydrator test cases, so no such regression bugs should occur in the future. Thanks @HypeMC |
Thanks @HypeMC ! |
Hello, when can we expect this to be released? |
Soon ™️ I think we should try to batch #10059 in the same release, and it looks ready. |
There is a further issue here. hasChangedField is always returning true for an enum regardless of whether it actually changed. When using hasChangedField('status') it shows it as changed when it hasn't. |
Just further to my last comment, when dumping the old/new values. The difference is that getOldValue() gives the enum object whereas getNewValue() return the enum's value. My guess is the comparison is failing because these should both be the enum object? |
@trsteel88 there is a separate PR for this issue #10074 |
Fixes #10057.
After upgrading to version
2.13.2
I started getting the following error:It happens when an enum is used with the
QueryBuilder
, eg:Caused by #10041.
Since my knowledge of the ORM code base is limited I'm not sure if this is the best place to fix the bug, so any suggestions are appreciated.