Skip to content

Category auto-generate URL problem #311

Closed
@SKovbel

Description

@SKovbel

I see this problem from version 1.4.0.2. (This problem is present at least 5 years.)

When creating new Category and input Name with non-English symbols and save then system auto-generate URL like 'doed-n-d-d-d-d-n-d-d-n-d-d-d-n-d-n.html' instead of 'moja-novaja-kategorija.html'

For Product auto-generating URL works fine - 'moja-novaja-kategorija.html'.

I fixing this bug in class Mage_Catalog_Model_Category by changing formatUrlKey function - calling formatUrlKey from Mage_Catalog_Model_Product_Url.

public function formatUrlKey($str)
{
    return Mage::getSingleton('catalog/product_url')->formatUrlKey($str);
}

instead of native function

public function formatUrlKey($str)
{
    $str = Mage::helper('Mage_Core_Helper_Data')->removeAccents($str);
    $urlKey = preg_replace('#[^0-9a-z]+#i', '-', $str);
    $urlKey = strtolower($urlKey);
    $urlKey = trim($urlKey, '-');
    return $urlKey;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions