Suthichai Posted January 2, 2013 Share Posted January 2, 2013 (edited) By overriding Dispatcher.php and Validate.php in 1.5.2.0, I was able to input and display Thai Friendly URL. But 1.5.3.0 (and 1.5.3.1) have suddenly fixed something that isn't broken, Now other language including Thai can't be input in Friendly URL(Catalog > Products > SEO). If I manually edit link_rewrite field in ps_product_lang and input Thai (via phpMyAdmin), the friendly URL can be saved and displayed correctly. After closely looked at the code, notice that there is new constant $PS_ALLOW_ACCENTED_CHARS_URL in some javascript code that blacklist certain characters to be accepted. So what is $PS_ALLOW_ACCENTED_CHARS_URL, can it be set somewhere in in BO or it need to be manually defined. Please help! {if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL} var PS_ALLOW_ACCENTED_CHARS_URL = 1; {else} var PS_ALLOW_ACCENTED_CHARS_URL = 0; {/if} Edited January 2, 2013 by Suthichai (see edit history) Link to comment Share on other sites More sharing options...
the.rampage.rado Posted January 2, 2013 Share Posted January 2, 2013 Check out js/admin.js Link to comment Share on other sites More sharing options...
Suthichai Posted January 2, 2013 Author Share Posted January 2, 2013 I knew where is this constant. Just that I don't know how to get and set this value. In fact these files are: /admin/themes/default/template/controllers/categories/helpers/form/form.tpl /admin/themes/default/template/controllers/cms/helpers/form/form.tpl /admin/themes/default/template/controllers/cms_categories/helpers/form/form.tpl /admin/themes/default/template/controllers/products/informations.tpl /classes/Tools.php /classes/Validate.php /js/admin.js /controllers/admin/AdminCategoriesController.php /controllers/admin/AdminCmsCategoriesController.php /controllers/admin/AdminCmsController.php /controllers/admin/AdminProductsController.php Link to comment Share on other sites More sharing options...
Suthichai Posted January 2, 2013 Author Share Posted January 2, 2013 I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field. Now I can input Thai in Catalog > Products > SEO > Friendly URL. 3 Link to comment Share on other sites More sharing options...
the.rampage.rado Posted January 2, 2013 Share Posted January 2, 2013 (edited) Are you able to place Cyrillic symbols this way? Like иИеЕрРФф EDIT: I tested it and it works! I simply can't imagine why they miss stuff like that... Thank you! Now I would be able to edit all my products.. Edited January 2, 2013 by the.rampage.rado (see edit history) Link to comment Share on other sites More sharing options...
Suthichai Posted January 2, 2013 Author Share Posted January 2, 2013 (edited) No, I can't. It converts to ииееррфф. I believe because the lowercase function. if (function_exists('mb_strtolower')) $str = mb_strtolower($str, 'utf-8'); Basically, I override \pL to \pL\pM in three files: 1. classes\Dispatcher.php (28 of them) 2. classes\Validate.php 3. classes\Tools.php Edited January 2, 2013 by Suthichai (see edit history) Link to comment Share on other sites More sharing options...
the.rampage.rado Posted January 2, 2013 Share Posted January 2, 2013 (edited) Yes it's lowering them but they're working now. They worked in like 1.5.0.17 and they stopped back then... Edited January 2, 2013 by the.rampage.rado (see edit history) Link to comment Share on other sites More sharing options...
AppleEater Posted February 2, 2013 Share Posted February 2, 2013 (edited) Thank you, This has solved the same problem for generating Friendly URL in Hebrew. The SQL code I used is: INSERT INTO `ps_configuration` (`id_configuration`, `id_shop_group`, `id_shop`, `name`, `value`, `date_add`, `date_upd`) VALUES (NULL, NULL, NULL, 'PS_ALLOW_ACCENTED_CHARS_URL', '1', '', ''); I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field. Now I can input Thai in Catalog > Products > SEO > Friendly URL. Edited February 2, 2013 by AppleEater (see edit history) 1 Link to comment Share on other sites More sharing options...
fong hong Posted January 5, 2015 Share Posted January 5, 2015 (edited) hi Mr Suthichai, Friendly URL in THAI LANGUAGE 1.how to insert phpMyAdmin Step by step ??? THIS below database i already insert. Am i do the right step ?? id_configuration id_shop_ group id_shop name value date_add date_upd 690 NULL NULL PS_ALLOW_ACCENTED_CHARS_URL 1 0000-00-00 00:00:00 0000-00-00 00:00:00 Hope u can Help me with above first issue. . .. Am i do the right step ?? 2. i solved it. Basically, I override \pL to \pL\pM in three files:a. classes\Dispatcher.php (28 of them)b. classes\Validate.phpc. classes\Tools.php ong Link here @ 7zhop.com I think I found where the problem is. I found that there are Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') in many places, but by looking at the database (ps_configuration), there isn't any refer to PS_ALLOW_ACCENTED_CHARS_URL, so I just insert this record and assign 1 to the value field.Now I can input Thai in Catalog > Products > SEO > Friendly URL. Edited January 7, 2015 by fong hong (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts