Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Patch for code that is not following best practices in Magento development #48

wants to merge 2 commits into from

2 participants


See attached commit, where using of collection for retrieving address by id is replaced by using of standard load method of the model.

Created as new pull request, since previous one was using master branch, instead of custom one.


Thank you for the valuable contribution and mistakes-free implementation. Your contribution has been accepted, it will be available with the upcoming publications.

Automated tests for these particular changes appeared to be pretty simple, so we implemented them.
However, please make sure to supply all contributions with automated tests (unit or integration).

Closing the ticket

@magento-team magento-team referenced this pull request from a commit
@magento-team magento-team Update as of 8/26/2012
* Decoupled Tag module functionality from other modules
* Visual Design Editor:
  * Implemented tracking of user changes history and rendering the actions at VDE toolbar
  * Implemented compacting of user changes history. Compacting is done in order to save all the changes as a minimal layout update.
* Improvements:
  * Added Atlassian IDE Plugin configuration files to `.gitignore`
  * Relocated `add_to_cart`, `checkout` and `product_edit` performance scenarios from `samples` to the normal `testsuite` directory. These scenarios can be used for Magento performance testing.
  * Implemented verification of number of orders that were created during execution of `checkout` performance scenario
  * Removed usage of deprecated `PHPUnit_Extensions_OutputTestCase` class from unit tests
* Fixes:
  * Fixed MySQL DB adapter to always throw exception, if it was not able to connect to DB because of wrong configuration. So now the adapter's behavior is not dependent on `error_reporting` settings.
  * Added the missing closing tag to New Order email template
  * Fixed `Mage_ImportExport_Model_Import_Entity_CustomerComposite` integration test issues
  * Marked several integration tests in `Mage_Adminhtml_CustomerControllerTest` as incomplete, as the tested functionality was not MMDB-compliant
  * Fixed issue with unit tests failure, when there was a Zend Framework installed as PEAR package
  * Fixed `advanced_search` performance scenario to fail, if the searched product doesn't exist
  * Fixed issue with non-escaped latest message link in admin backend
* GitHub requests:
  * [#48](#48) -- fixed usage of a collection at the place, where just a single object was needed
@mmansoorebay mmansoorebay referenced this pull request from a commit
@sshymko sshymko Implemented MAGETWO-2696: GitHub Tickets Processing 40
- accepted contribution #48
- implemented integration tests missing in the original contribution
@mmansoorebay mmansoorebay referenced this pull request from a commit
@sshymko sshymko Fixed MAGETWO-2696: GitHub Tickets Processing 40
- fixed re-emerged MAGE-2416 as result of accepting the contribution #48
-- removed events 'enterprise_customer_address_attribute_save' and 'enterprise_customer_address_attribute_delete' in favour of generic 'customer_entity_attribute_save_commit_after' and 'customer_entity_attribute_delete_commit_after' accordingly
-- introduced customer address' attributes loading as soon as address model is loaded (besides of loading through a collection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 19, 2012
  1. @IvanChepurnyi

    Fixed non reasonable usage of memory for collection, where possible t…

    IvanChepurnyi committed
    …o use more appropriate load() method of the model.
  2. @IvanChepurnyi
This page is out of date. Refresh to see the latest.
7 app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php
@@ -721,11 +721,8 @@ public function transactionsAction()
public function addressAction()
$addressId = $this->getRequest()->getParam('address_id');
- $address = Mage::getModel('Mage_Sales_Model_Order_Address')
- ->getCollection()
- ->addFilter('entity_id', $addressId)
- ->getItemById($addressId);
- if ($address) {
+ $address = Mage::getModel('Mage_Sales_Model_Order_Address')->load($addressId);
+ if ($address->getId()) {
Mage::register('order_address', $address);
// Do not display VAT validation button on edit order address form
Something went wrong with that request. Please try again.