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

(Try to) add a reproducer for #10868 #10873

Draft
wants to merge 2 commits into
base: 2.16.x
Choose a base branch
from
Draft

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Aug 3, 2023

See #10868

@mpdude mpdude mentioned this pull request Aug 3, 2023

$order->orderProducts->count();

$reference = $this->_em->getReference(GH10868Offer::class, [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a reference (proxy) for a GH10868Offer object.

$this->_em->flush();
$this->_em->clear();

$order->orderProducts->count();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should not do that, since $order belongs to an EM instance that has been cleared.

'id' => $offer->id,
]);

$orderProductFromOrder = $order->orderProducts->first();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should not do anything off $order, since it is an entity from an EM that has been cleared.

@tasselchof
Copy link

Ok, I didn't paid enough attention to this thing as I was not trying to isolate such cases before. After getting order once more it worked. The question is how to reproduce case that I have in live code...

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 this pull request may close these issues.

None yet

2 participants