Magento error in order by name for directory_country_region bug

  • Posted on: 23 February 2013
  • By: markus.wilhelm

Dear all,
after searching like hell for solving the error message while trying to save the system default configuration in Magento I finally found an "error". Not sure where this comes from: Magento, German Market Ready. Whell I don't care, it now works ;-)
Just change the file: app/code/core/Mage/Directory/Model/Resource/Region/Collection.php

class Mage_Directory_Model_Resource_Region_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
...
 
 protected function _construct()
    {
        $this->_init('directory/region');
 
        $this->_countryTable    = $this->getTable('directory/country');
        $this->_regionNameTable = $this->getTable('directory/country_region_name');
 
// comment out the next line-----------------------------------------------
        //$this->addOrder('name', Varien_Data_Collection::SORT_ORDER_ASC);
// ------------------------------------------------------------------------
        $this->addOrder('default_name', Varien_Data_Collection::SORT_ORDER_ASC);
    }
...
}
BR Markus