diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 62985c53b..3a465fdcb 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -440,7 +440,7 @@ class AdminCategoriesControllerCore extends AdminController 'name' => 'link_rewrite', 'lang' => true, 'required' => true, - 'hint' => $this->l('Forbidden characters:').' <>;=#{}' + 'hint' => $this->l('Forbidden characters:').' <>;=#{}%' ), array( 'type' => 'group', @@ -544,7 +544,7 @@ class AdminCategoriesControllerCore extends AdminController $object = parent::processAdd(); //if we create a you root category you have to associate to a shop before to add sub categories in. So we redirect to AdminCategories listing - if (Tools::isSubmit('is_root_category')) + if ($object && Tools::isSubmit('is_root_category')) Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminCategories').'&conf=3'); return $object; diff --git a/js/admin.js b/js/admin.js index 1bd5946b8..ca3893428 100644 --- a/js/admin.js +++ b/js/admin.js @@ -51,7 +51,7 @@ function str2url(str,encoding,ucfirst) function copy2friendlyURL() { - $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8')); + $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', '')); if ($('#friendly-url')) $('#friendly-url').html($('#link_rewrite_' + id_language).val()); // trigger onchange event to use anything binded there