Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem opening language files


csmartin

Recommended Posts

Posted

HI everyone, I am getting a strange error using both the latest version of oscommerce, and an older version i have set up for a client:

 

Warning: main(includes/languages/.php) [function.main]: failed to open stream: No such file or directory in /usr/home/nycalendars/public_html/new_cart/includes/application_top.php on line 285

 

Fatal error: main() [function.require]: Failed opening required 'includes/languages/.php' (include_path='.:') in /usr/home/nycalendars/public_html/new_cart/includes/application_top.php on line 285

 

 

I think it may be related to sessions somehow, since when i bring up the page fresh on a browser, it works the first time, but if i click on a link or do anything to load that page, or another page, i get the above error.

 

 

Has anyone seen this error before, or have any advice about what to do?

 

Thanks,

Chris

Posted
Check

 

Admin -> Localizations -> Languages

 

Make sure you have one set as default.

 

I get the same error in the shopping section, and in the administration section.

 

Is there a configuration parameter or database value i can change to set this?

 

Thanks,

Chris

Posted
I get the same error in the shopping section, and in the administration section.

 

Is there a configuration parameter or database value i can change to set this?

 

Thanks,

Chris

 

 

After looking in the configuration table, i see that the DEFAULT_LANGUAGE setting is set to en. I am running this on php5 with mysql5 as well, and i have tried applying the contributions for making oscommerce work with PHP5 but that does not seem to help either. Any suggestions?

Posted

I think the language class is a little buggy, this code should not slip through without setting the $language.

 

includes/application_top #264

 

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
if (!tep_session_is_registered('language')) {
  tep_session_register('language');
  tep_session_register('languages_id');
}

include(DIR_WS_CLASSES . 'language.php');
$lng = new language();

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
  $lng->set_language($HTTP_GET_VARS['language']);
} else {
  $lng->get_browser_language();
}

$language = $lng->language['directory'];
$languages_id = $lng->language['id'];
 }

// include the language translations

//////  There should be no possibility to reach the next line if $language=''

 require(DIR_WS_LANGUAGES . $language . '.php');

 

I always modify it, try something like this before the require.

 

if (!isset($language) || $language == '') {
tep_session_register('language');
tep_session_register('languages_id');
$language = 'english';
$languages_id = 'en';
 }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...