Skip to content

Commit

Permalink
MAGETWO-39905: UI components compatibility with Search API
Browse files Browse the repository at this point in the history
  • Loading branch information
akaplya committed Aug 10, 2015
1 parent e4b30d3 commit 7987275
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/code/Magento/Sales/Controller/Adminhtml/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Magento\Sales\Api\OrderManagementInterface;
use Magento\Sales\Api\OrderRepositoryInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\InputException;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -149,6 +150,10 @@ protected function _initOrder()
$this->messageManager->addError(__('This order no longer exists.'));
$this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
return false;
} catch (InputException $e) {
$this->messageManager->addError(__('This order no longer exists.'));
$this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
return false;
}
$this->_coreRegistry->register('sales_order', $order);
$this->_coreRegistry->register('current_order', $order);
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Model/OrderRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ public function __construct(
public function get($id)
{
if (!$id) {
throw new InputException('Id required');
throw new InputException(__('Id required'));
}
if (!isset($this->registry[$id])) {
/** @var \Magento\Sales\Api\Data\OrderInterface $entity */
$entity = $this->metadata->getNewInstance();
$this->metadata->getMapper()->load($entity, $id);
if (!$entity->getEntityId()) {
throw new NoSuchEntityException('Requested entity doesn\'t exist');
throw new NoSuchEntityException(__('Requested entity doesn\'t exist'));
}
$this->registry[$id] = $entity;
}
Expand Down

0 comments on commit 7987275

Please sign in to comment.