[-] BO : fixed bug #PSCFV-5141 - Product Url being rewritten when a product is edited
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
<input size="30" type="text" id="{$input_name}_{$language.id_lang}"
|
<input size="30" type="text" id="{$input_name}_{$language.id_lang}"
|
||||||
name="{$input_name}_{$language.id_lang}"
|
name="{$input_name}_{$language.id_lang}"
|
||||||
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
|
value="{$input_value[$language.id_lang]|htmlentitiesUTF8|default:''}"
|
||||||
onchange="updateFriendlyURL();"
|
|
||||||
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"/>
|
onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();"/>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|||||||
@@ -482,7 +482,6 @@ product_tabs['Seo'] = new function(){
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.onReady = function() {
|
this.onReady = function() {
|
||||||
copy2friendlyURL();
|
|
||||||
// Enable writing of the product name when the friendly url field in tab SEO is loaded
|
// Enable writing of the product name when the friendly url field in tab SEO is loaded
|
||||||
$('.copy2friendlyUrl').removeAttr('disabled');
|
$('.copy2friendlyUrl').removeAttr('disabled');
|
||||||
|
|
||||||
@@ -1578,9 +1577,7 @@ tabs_manager.setTabs(product_tabs);
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// The manager schedules the onReady() methods of each tab to be called when the tab is loaded
|
// The manager schedules the onReady() methods of each tab to be called when the tab is loaded
|
||||||
tabs_manager.init();
|
tabs_manager.init();
|
||||||
|
|
||||||
updateCurrentText();
|
updateCurrentText();
|
||||||
|
|
||||||
$("#name_" + id_lang_default + ",#link_rewrite_" + id_lang_default)
|
$("#name_" + id_lang_default + ",#link_rewrite_" + id_lang_default)
|
||||||
.live("change", function(e)
|
.live("change", function(e)
|
||||||
{
|
{
|
||||||
@@ -1592,7 +1589,6 @@ $(document).ready(function() {
|
|||||||
{
|
{
|
||||||
handleSaveButtons()
|
handleSaveButtons()
|
||||||
});
|
});
|
||||||
updateFriendlyURL();
|
|
||||||
|
|
||||||
// Pressing enter in an input field should not submit the form
|
// Pressing enter in an input field should not submit the form
|
||||||
$('#product_form').delegate('input', 'keypress', function(e){
|
$('#product_form').delegate('input', 'keypress', function(e){
|
||||||
@@ -1601,4 +1597,3 @@ $(document).ready(function() {
|
|||||||
return (code == 13) ? false : true;
|
return (code == 13) ? false : true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+10
-7
@@ -53,11 +53,14 @@ function str2url(str,encoding,ucfirst)
|
|||||||
|
|
||||||
function copy2friendlyURL()
|
function copy2friendlyURL()
|
||||||
{
|
{
|
||||||
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
|
if (!$('#link_rewrite_' + id_language).val().length)//check if user didn't type anything in rewrite field, to prevent overwriting
|
||||||
if ($('#friendly-url'))
|
{
|
||||||
$('#friendly-url').html($('#link_rewrite_' + id_language).val());
|
$('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', ''));
|
||||||
// trigger onchange event to use anything binded there
|
if ($('#friendly-url'))
|
||||||
$('#link_rewrite_' + id_language).change();
|
$('#friendly-url').html($('#link_rewrite_' + id_language).val());
|
||||||
|
// trigger onchange event to use anything binded there
|
||||||
|
$('#link_rewrite_' + id_language).change();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +124,7 @@ function changeFormLanguage(id_language_new, iso_code, employee_cookie)
|
|||||||
if (employee_cookie)
|
if (employee_cookie)
|
||||||
$.post("ajax.php", { form_language_id: id_language_new });
|
$.post("ajax.php", { form_language_id: id_language_new });
|
||||||
id_language = id_language_new;
|
id_language = id_language_new;
|
||||||
updateFriendlyURL();
|
|
||||||
updateCurrentText();
|
updateCurrentText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,7 +694,7 @@ $(document).ready(function()
|
|||||||
if(isArrowKey(e))
|
if(isArrowKey(e))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
updateCurrentText()
|
updateCurrentText();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".copyMeta2friendlyURL").live('keyup change',function(e){
|
$(".copyMeta2friendlyURL").live('keyup change',function(e){
|
||||||
|
|||||||
Reference in New Issue
Block a user