From 90091d4f2c7d2ae53e2c934489843d1d17c35adb Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 12 Sep 2013 10:50:04 +0200 Subject: [PATCH] [-] BO : Do not copy link_rewrite from title if cms already has one --- controllers/admin/AdminCmsController.php | 4 ++-- js/admin.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminCmsController.php b/controllers/admin/AdminCmsController.php index c46c61b88..8d77909e4 100644 --- a/controllers/admin/AdminCmsController.php +++ b/controllers/admin/AdminCmsController.php @@ -110,10 +110,10 @@ class AdminCmsControllerCore extends AdminController 'type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', - 'id' => 'name', // for copy2friendlyUrl compatibility + 'id' => 'name', // for copyMeta2friendlyURL compatibility 'lang' => true, 'required' => true, - 'class' => 'copy2friendlyUrl', + 'class' => 'copyMeta2friendlyURL', 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'size' => 50 ), diff --git a/js/admin.js b/js/admin.js index 7904d724b..e4bee41e9 100644 --- a/js/admin.js +++ b/js/admin.js @@ -119,7 +119,8 @@ function copy2friendlyURL() function copyMeta2friendlyURL() { - $('#input_link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8')); + if (!$('input[name="id_cms"]').length) + $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8')); } function updateCurrentText()