Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category auto-generate URL problem #311

Closed
SKovbel opened this issue Jun 15, 2013 · 2 comments
Closed

Category auto-generate URL problem #311

SKovbel opened this issue Jun 15, 2013 · 2 comments

Comments

@SKovbel
Copy link

SKovbel commented Jun 15, 2013

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;
}
@magento-team
Copy link
Contributor

Hello. Could you please provide a pull request and tests for this change?

@SKovbel
Copy link
Author

SKovbel commented Jun 19, 2013

Yes i can. I will do it a bit later.

@SKovbel SKovbel closed this as completed Jun 19, 2013
magento-team pushed a commit that referenced this issue May 22, 2015
[Mavericks] Re-factor and maintain functional tests
okorshenko pushed a commit that referenced this issue Jan 20, 2016
magento-engcom-team added a commit that referenced this issue Mar 13, 2019
 - Merge Pull Request magento/graphql-ce#311 from ldusan84/graphql-ce:feature/category-with-products-fix
 - Merged commits:
   1. d41c407
   2. 5bf7364
   3. 8d828da
   4. 996ba90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants