Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can someone help me?


Guest

Recommended Posts

Posted

What is causing this error? This isn't for anything nuke related and I am having trouble getting an account registered at the OsCommerce site in order to ask for help there with this. I am hoping someone here may be able to answer this.

 

 

Call to undefined function: tep_not_null() in /home/xxxx/public_html/xxxxx/includes/classes/language.php on line 74

 

$this->catalog_languages = array();

$languages_query = tep_db_query("select languages_id, name, code, image, directory from " . TABLE_LANGUAGES . " order by sort_order");

while ($languages = tep_db_fetch_array($languages_query)) {

$this->catalog_languages[$languages['code']] = array('id' => $languages['languages_id'],

'name' => $languages['name'],

'image' => $languages['image'],

'directory' => $languages['directory']);

}

 

$this->browser_languages = '';

$this->language = '';

 

$this->set_language($lng); ((This is line 74))

}

 

function set_language($language) {

if ( (tep_not_null($language)) && (isset($this->catalog_languages[$language])) ) {

$this->language = $this->catalog_languages[$language];

} else {

$this->language = $this->catalog_languages[DEFAULT_LANGUAGE];

}

}

function get_browser_language() {

$this->browser_languages = explode(',', getenv('HTTP_ACCEPT_LANGUAGE'));

 

for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {

reset($this->languages);

while (list($key, $value) = each($this->languages)) {

if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {

$this->language = $this->catalog_languages[$key];

break 2;

}

}

}

}

}

?>

Posted

You are missing the following function in catalog/includes/functions/general.php:

 

  function tep_not_null($value) {
   if (is_array($value)) {
     if (sizeof($value) > 0) {
       return true;
     } else {
       return false;
     }
   } else {
     if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) {
       return true;
     } else {
       return false;
     }
   }
 }

 

Matti

Posted

I checked the file and its in there. Could it be one of the contributions that I added to the catalog causing this error to appear?

Posted

I would say it is an installed contribution...

 

Remember, tep_not_null() is a core function and will affect almost every script. I find it hard to believe the store will function as expected.

 

If it is present in general.php and not being included what about the rest of the functions? I think you have deeper problems that tep_not_null() and should retrace your steps for whatever contribution would present like this.

 

Bobby

Archived

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

×
×
  • Create New...