Skip to content
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

Fetched Entity with native Enum field with non empty changeSet (Enum <=> string) #10071

Closed
mzk opened this issue Sep 27, 2022 · 0 comments · Fixed by #10074
Closed

Fetched Entity with native Enum field with non empty changeSet (Enum <=> string) #10071

mzk opened this issue Sep 27, 2022 · 0 comments · Fixed by #10074

Comments

@mzk
Copy link
Contributor

mzk commented Sep 27, 2022

Bug Report

// Order.php
    #[Column(type: Types::STRING, nullable: false, enumType: OrderStatus::class, options: ['charset' => 'utf8', 'collation' => 'utf8_unicode_ci'])]
    private OrderStatus $orderStatus;


// code.
$order = new Order();
$em->flush();
$em->clear();

$freshOrder = $em->createQueryBuilder()->select('o')->from(Order::class, 'o')->setMaxResults(1)->getQuery()->getSingleResult();

$uow->computeChangeSets();
$em->getUnitOfWork()->isScheduledForDelete($order); // returns true.

(The freshEneity is scheduled for the update because in the changeSet is 'strinngValue' of Enum::Foo.

But when I get the Entity like this

$freshEntity = $this->getEntityManager()->find(Order::class, $orderId);
$uow->computeChangeSets();
$em->getUnitOfWork()->isScheduledForUpdate($order); // returns false, there is no update on fresh Entity.
Q A
BC Break yes
Version 2.13.x-dev

Summary

The $freshEntity with native Enum field shouldn't scheduled for updated

the failing test case is here #10073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant