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

Order Item Repository saving and deleting items on the null key in registry #36172

Open
wants to merge 9 commits into
base: 2.4-develop
Choose a base branch
from
6 changes: 3 additions & 3 deletions app/code/Magento/Sales/Model/Order/ItemRepository.php
Expand Up @@ -142,7 +142,7 @@ public function getList(SearchCriteriaInterface $searchCriteria)
public function delete(OrderItemInterface $entity)
{
$this->metadata->getMapper()->delete($entity);
unset($this->registry[$entity->getEntityId()]);
unset($this->registry[$entity->getItemId()]);
return true;
}

Expand Down Expand Up @@ -171,8 +171,8 @@ public function save(OrderItemInterface $entity)
}

$this->metadata->getMapper()->save($entity);
$this->registry[$entity->getEntityId()] = $entity;
return $this->registry[$entity->getEntityId()];
$this->registry[$entity->getItemId()] = $entity;
return $this->registry[$entity->getItemId()];
}

/**
Expand Down