Forums / Bug Reports / [DONE] Default Language Selection in Admin

[DONE] Default Language Selection in Admin

Locked

Views: 2,773

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
9 Jun 2006, 5:46 AM
#1
ericlaska avatar

ericlaska

New Zenner

Join Date:
May 2006
Posts:
2
Plugin Contributions:
0

[DONE] Default Language Selection in Admin

Dear All,

May be a Bug,

When you have more than on language, and you select on to edit.
As soon as you Update it, even without any modification and without selecting the checkbox "Set as default" language, it become automatically your Default language.

It do not happends when you create a new language but only when you edit it.

this with Zen Cart V1.3.0.1

tks and rgds

9 Jun 2006, 6:37 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [DONE] Default Language Selection in Admin

Hmmm ... yes ... a bug....
here's the fix:

/admin/languages.php
line 189 starts with:php // check if we're changing settings for the default language $result = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'"); $default_lang_change_flag = (DEFAULT_LANGUAGE == $result->fields['code'] && DEFAULT_LANGUAGE == $code) ? false : true; replace that with:```php
// check if the spelling of the name for the default language has just been changed (thus meaning we need to change the spelling of DEFAULT_LANGUAGE to match it)
$result = $db->Execute("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$lID . "'");
$changing_default_lang = (DEFAULT_LANGUAGE == $result->fields['code']) ? true : false;
$default_needs_an_update = (DEFAULT_LANGUAGE == $code) ? false : true;
$default_lang_change_flag = ($default_needs_an_update && $changing_default_lang) ? true : false;

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jun 2006, 9:35 AM
#3
ericlaska avatar

ericlaska

New Zenner

Join Date:
May 2006
Posts:
2
Plugin Contributions:
0

Re: [DONE] Default Language Selection in Admin

Thank you DrByte
:thumbsup: