We received the following Magento core patch:
Index: app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php
===================================================================
--- app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php
app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php (working copy)
@@ -718,6 +718,7 @@
$addressId = $this->getRequest()->getParam('address_id');
$address = Mage::getModel('sales/order_address')
->getCollection()
+ ->addFilter('entity_id', $addressId)
->getItemById($addressId);
if ($address) {
Mage::register('order_address', $address);
In my opinion this is equivalent to
$addressId = $this->getRequest()->getParam('address_id');
$address = Mage::getModel('sales/order_address')->load($addressId);
if ($address->getId()) {
Mage::register('order_address', $address);
What is the advantage of the original patch over my solution?
EDIT:
The explanation from the support was:
[...] this decision was by design and appropriate when creating this code.
The only reason for that kind of patch seems to be to edit a minimal number of lines.
In Magento2 this is implemented in the second way:
$address = Mage::getModel('Mage_Sales_Model_Order_Address')->load($addressId);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With