Author Topic: Comma in alias  (Read 1426 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 266
Comma in alias
« on: November 01, 2017, 05:20:20 am »
When I create new categories VM 3.2.4 doesn't remove commas from the alias field which breaks my urls.

sandomatyas

  • Jr. Member
  • **
  • Posts: 266
Re: Comma in alias
« Reply #1 on: July 26, 2018, 15:18:12 pm »
It's still in 3.2.14

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9825
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Comma in alias
« Reply #2 on: July 29, 2018, 22:06:17 pm »
commas do not break urls!
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2112
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Comma in alias
« Reply #3 on: July 29, 2018, 23:46:16 pm »
Yes, commas are allowed in urls but they can make them look visually strange. Although allowed, there is good reason to stay away from commas. Perhaps they should be translated to '-'. Or you could simply not use commas in categories and product names? I have no definite solution to this.
Jörgen @ Kreativ Fotografi
Joomla 3.9.1
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9825
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Comma in alias
« Reply #4 on: August 02, 2018, 11:27:33 am »
or we add a VmConfig
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 2112
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Comma in alias
« Reply #5 on: August 02, 2018, 11:28:25 am »
Sounds like a good idea :)
Jörgen @ Kreativ Fotografi
Joomla 3.9.1
Virtuemart 3.2.12
Olympiantheme Hera (customized)

sandomatyas

  • Jr. Member
  • **
  • Posts: 266
Re: Comma in alias
« Reply #6 on: August 13, 2018, 14:09:01 pm »
or we add a VmConfig

Simple, elegant, powerful. I like it :)

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 264
    • Bulgarian Computer Store
Re: Comma in alias
« Reply #7 on: February 25, 2019, 09:21:33 am »
This problem continues to exist. If you put a comma in the name of the product, it does not transform into a dash.

Do I miss something or still have no solution?
No pain, no gain, no site!

beny.rfg

  • Beginner
  • *
  • Posts: 21
  • A beginner
Re: Comma in alias
« Reply #8 on: March 22, 2019, 23:58:20 pm »
Hi there,

I have the same problem, how can I fix it? Moreover, if I together set in virtuemart.cfg "transliterateSlugs=1" (because I need remove diacritics from url), comma is replaced to "%2C" and product url is crashed (404).

1. original alias: /bio-kapsička-jablko,-karotka-ovko-90-g
2. with "transliterateSlugs=1": /bio-kapsicka-jablko%2C-karotka-ovko-90-g,
3. I need this: /bio-kapsicka-jablko-karotka-ovko-90-g

Thanks, Petr

diri

  • Jr. Member
  • **
  • Posts: 58
  • VirtueMart Version: most recent dev version (trunk)
Re: Comma in alias
« Reply #9 on: March 23, 2019, 05:09:18 am »
@benny.rfg:

Please give a hint for me how system should be able to find the link you want to see when somebody clicks instead of real link you typed (with comma).

For me it look like you want a third stage for having a second alias.

Currently it has two stages only:
1. real name
2. alias

You want:
3. alias of alias

Or, did I get it wrong?


beny.rfg

  • Beginner
  • *
  • Posts: 21
  • A beginner
Re: Comma in alias
« Reply #10 on: March 23, 2019, 11:29:23 am »
Hi Diri,

no, i just want to remove commas from the URLs.

Instead this: /bio-kapsicka-jablko,-karotka,-banan-ovko-90-g-detail I need this: /bio-kapsicka-jablko-karotka-banan-ovko-90-g-detail

Thanks, Petr

diri

  • Jr. Member
  • **
  • Posts: 58
  • VirtueMart Version: most recent dev version (trunk)
Re: Comma in alias
« Reply #11 on: March 28, 2019, 14:14:25 pm »
One can edit alias.

What about deleting comma there?

Jenny2025

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Comma in alias
« Reply #12 on: April 01, 2019, 12:04:09 pm »
Confirm. I have the same problem with my sites.
Every time I edit in the Virtuemart code to fix it.

Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

This problem is not new. Here is a link to the 2014 article on the solution we have to use when creating a new Virtuemart store https://jdevelop.info/articles/joomla-extensions/420-net-transliteratsii-v-virtuemart-2-6-6
My sites use russian language (ru-RU).
The problem occurs when you enable transliteration in Virtuemart settings (thank you for taking this option to settings).

Problem with symbols:

, - replaced by %2C. Comma can be removed when forming an alias;

ъ - when creating a category/product with this letter, it is replaced by the characters %D1%8A. The letter ъ can be removed when forming an alias;

Category/product on the site does not open because of the % symbol. % breaks the link.
When you re-save the category/product % is deleted, the letters are converted to lowercase. It turns out like this d1-8a.

" - commas. This problem is not of transleithania, and the field category name/product. When you create a category/product with quotes, for example, Набор кастрюль "Ромашки", the alias is generated correct nabor-kastryul-romashki, but in the category/product name field only Набор кастрюль is displayed, and if you save, then this name will be saved and the site will be displayed as Набор кастрюль, and Ромашки is already hopelessly lost.

Link to the decision http://virtuemart.su/forums/topic/obrezaet-nazvanie-kategorii-posle/

/administrator/components/com_virtuemart/views/product/tmpl/product_edit_information.php
<input class="required inputbox" type="text" name="product_name" id="product_name" value="<?php echo htmlspecialchars($this->product->product_name); ?>" size="32" maxlength="255" />

/administrator/components/com_virtuemart/views/category/tmpl/edit_categoryform.php
<?php echo VmHTML::row('raw','COM_VIRTUEMART_CATEGORY_NAME',VmHtml::input('category_name',htmlspecialchars($this->category->category_name),'class="required inputbox"').$this->origLang); ?>

Please tell me how we can solve this problem once and for all?
Excuse me for my English.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9825
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Comma in alias
« Reply #13 on: April 10, 2019, 09:20:40 am »
Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

Transliterate slugs just enables the joomla standard transliteration!
Code: [Select]
$unicodeslugs = VmConfig::get('transliterateSlugs',false);
if($unicodeslugs){
$lang = vmLanguage::getLanguage();
$this->$slugName = $lang->transliterate($this->$slugName);
}

$lang is just the normal joomla language.

What you do is using two settings which do not work together. In joomla you have a configuration setting for the URLS, check your SEO settings and there is a setting called "Unicode Aliases" and these setting creates your % and then you have transliterateSlugs enabled, that does not work as you explained yourself perfectly
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jenny2025

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Comma in alias
« Reply #14 on: April 30, 2019, 12:40:00 pm »
Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

Transliterate slugs just enables the joomla standard transliteration!
Code: [Select]
$unicodeslugs = VmConfig::get('transliterateSlugs',false);
if($unicodeslugs){
$lang = vmLanguage::getLanguage();
$this->$slugName = $lang->transliterate($this->$slugName);
}

$lang is just the normal joomla language.

What you do is using two settings which do not work together. In joomla you have a configuration setting for the URLS, check your SEO settings and there is a setting called "Unicode Aliases" and these setting creates your % and then you have transliterateSlugs enabled, that does not work as you explained yourself perfectly


We do not use Unicode in url. This is bad for SEO and links look ugly when you share a link.
We use url with Latin letters.
An example of a category http://krai.user2065992.atservers.net/katalog/obogrevateli-na-solyarke-i-kerosine


1. I installed the latest version of Joomla
I do nothing, just create article in the "Content - Articles".
The subject article of this set: Запятая , Твердый знак ъ и кавычки " - наши лучшие друзья
Save article.
Joomla forms an alias: zapyataya-tverdyj-znak-i-kavychki-nashi-luchshie-druzya

Perfect! Clean and no extra characters. The comma and the letter "ъ" have been deleted.


2. I am installing the latest version of Virtuemart.
Do not do anything, just create a product in Virtuemart.
Name of product ask such same: Запятая , Твердый знак ъ и кавычки " - наши лучшие друзья
Save product.
Virtuemart forms an alias: запятая-,-твердый-знак-ъ-и-кавычки-наши-лучшие-друзья
https://yadi.sk/i/KBR0FMgmJEV9TA

Cyrillic... It seems that everything looks not bad, but it needs to be like this: "zapyataya-tverdyj-znak-i-kavychki-nashi-luchshie-druzya".

Output to the main Virtuemart, check how the product opens.
http://slugs/index.php/%D0%B7%D0%B0%D0%BF%D1%8F%D1%82%D0%B0%D1%8F-,-%D1%82%D0%B2%D0%B5%D1%80%D0%B4%D1%8B%D0%B9-%D0%B7%D0%BD%D0%B0%D0%BA-%D1%8A-%D0%B8-%D0%BA%D0%B0%D0%B2%D1%8B%D1%87%D0%BA%D0%B8-%D0%BD%D0%B0%D1%88%D0%B8-%D0%BB%D1%83%D1%87%D1%88%D0%B8%D0%B5-%D0%B4%D1%80%D1%83%D0%B7%D1%8C%D1%8F-detail
Comma really does not break the link and the product successfully breaks away. But just look at this link! It's awful! That's why we do not use Cyrillic in the url.

3. Go to Virtuemart settings and in the tab SEO enable "Transliterate slugs".
Save the settings, and create a product with the same name: Запятая , Твердый знак ъ и кавычки " - наши лучшие друзья
Virtuemart enabled setting "Transliterate slugs" forms an alias: zapyataya-%2C-tverdyj-znak-%D1%8A-i-kavychki-nashi-luchshie-druzya
https://yadi.sk/i/qwbUsdQiXzEpnA

Go to the site, trying to go to the product page, the link he has this:
http://slugs/index.php/zapyataya-%2C-tverdyj-znak-%D1%8A-i-kavychki-nashi-luchshie-druzya-1-detail
But we stay on the category page and the message is displayed "404 The requested product does not exist."
https://yadi.sk/i/v9x1I4aA-MOoFQ

You see this? %2C %D1%8A - they break the link!
Settings Joomla and Virtuemart
https://yadi.sk/i/1vOLoXOgDdE6tg
https://yadi.sk/i/9ghYy4GvksD9BQ

_____________________________________

Result:
Quotes in the product name are no longer a problem. Thank you!  :)
The problem will remain in the category name https://yadi.sk/i/xeYmWKKNiPlfnQ. Here is an example where quotes are used in the category name http://krai.user2065992.atservers.net/katalog/zapchasti

Cyrillic in the url most do not use, because it is not beautiful.
In Joomla articles default transliteration to the Latin alphabet, comma and "ъ" are cut from the alias.

Example of search results in Google on request "купить дрель" ("buy a drill")
https://www.google.by/search?q=%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C+%D0%B4%D1%80%D0%B5%D0%BB%D1%8C&hl=ru&ei=BRvIXKrsMOjCrgSn8YPgDQ&start=0&sa=N&ved=0ahUKEwjqgtXyxffhAhVooYsKHaf4ANw4ChDy0wMIhQE&biw=1920&bih=937
On the first two pages of any website who would use Cyrillic in the url, only Latin.

Sincerely, Jenny