[-] BO : fix bug #PSCFV-2239 - js error on product page on IIS + PHP5.4

This commit is contained in:
tDidierjean
2012-05-09 16:50:05 +00:00
parent 682cbfea55
commit f3bd6fff58
3 changed files with 5 additions and 6 deletions
@@ -83,7 +83,6 @@
var token = '{$token}'; var token = '{$token}';
var id_product = {if isset($product->id)}{$product->id}{else}0{/if}; var id_product = {if isset($product->id)}{$product->id}{else}0{/if};
var defaultLanguage = {$defaultLanguage}; var defaultLanguage = {$defaultLanguage};
var product_type_pack = {Product::PTYPE_PACK}; var product_type_pack = {Product::PTYPE_PACK};
var product_type_virtual = {Product::PTYPE_VIRTUAL}; var product_type_virtual = {Product::PTYPE_VIRTUAL};
var product_type_simple = {Product::PTYPE_SIMPLE}; var product_type_simple = {Product::PTYPE_SIMPLE};
@@ -2152,7 +2152,7 @@ class AdminProductsControllerCore extends AdminController
$this->getLanguages(); $this->getLanguages();
$this->tpl_form_vars['defaultLanguage'] = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT')); $this->tpl_form_vars['defaultLanguage'] = Configuration::get('PS_LANG_DEFAULT');
$this->tpl_form_vars['currentIndex'] = self::$currentIndex; $this->tpl_form_vars['currentIndex'] = self::$currentIndex;
$this->tpl_form_vars['display_multishop_checkboxes'] = (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP && $this->display == 'edit'); $this->tpl_form_vars['display_multishop_checkboxes'] = (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP && $this->display == 'edit');
+4 -4
View File
@@ -415,12 +415,12 @@ function handleSaveButtons(e)
// common for all products // common for all products
// name[defaultlangid] // name[defaultlangid]
$("#disableSaveMessage").remove(); $("#disableSaveMessage").remove();
if ($("#name_"+defaultLanguage.id_lang).val() == "" && (!display_multishop_checkboxes || $('input[name=\'multishop_check[name]['+defaultLanguage.id_lang+']\']').prop('checked'))) if ($("#name_"+defaultLanguage).val() == "" && (!display_multishop_checkboxes || $('input[name=\'multishop_check[name]['+defaultLanguage+']\']').prop('checked')))
{ {
msg[i++] = empty_name_msg; msg[i++] = empty_name_msg;
} }
// check friendly_url_[defaultlangid] only if name is ok // check friendly_url_[defaultlangid] only if name is ok
else if ($("#link_rewrite_"+defaultLanguage.id_lang).val() == "" && (!display_multishop_checkboxes || $('input[name=\'link_rewrite[name]['+defaultLanguage.id_lang+']\']').prop('checked'))) else if ($("#link_rewrite_"+defaultLanguage).val() == "" && (!display_multishop_checkboxes || $('input[name=\'link_rewrite[name]['+defaultLanguage+']\']').prop('checked')))
msg[i++] = empty_link_rewrite_msg; msg[i++] = empty_link_rewrite_msg;
if (msg.length == 0) if (msg.length == 0)
@@ -1543,7 +1543,7 @@ $(document).ready(function() {
updateCurrentText(); updateCurrentText();
$("#name_"+defaultLanguage.id_lang+",#link_rewrite_"+defaultLanguage.id_lang) $("#name_"+defaultLanguage+",#link_rewrite_"+defaultLanguage)
.live("change", function(e) .live("change", function(e)
{ {
if(typeof e == KeyboardEvent) if(typeof e == KeyboardEvent)
@@ -1552,7 +1552,7 @@ $(document).ready(function() {
$(this).trigger("handleSaveButtons"); $(this).trigger("handleSaveButtons");
}); });
// bind that custom event // bind that custom event
$("#name_"+defaultLanguage.id_lang+",#link_rewrite_"+defaultLanguage.id_lang) $("#name_"+defaultLanguage+",#link_rewrite_"+defaultLanguage)
.live("handleSaveButtons", function(e) .live("handleSaveButtons", function(e)
{ {
handleSaveButtons() handleSaveButtons()