Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error when accessing catalog. please help


Guest

Recommended Posts

I get an error message when I try to click on anything on the catalog page. The only thing I have changed is the reference to languages on line 285 ( require(DIR_WS_LANGUAGES . 'english.php' ). This is the error message I recieve:

 

Fatal error: Call to a member function on a non-object in /myserver/catalog/includes/application_top.php on line 310

 

Here is the code as it appears in application_top

 

// navigation history

 if (tep_session_is_registered('navigation')) {

   if (PHP_VERSION < 4) {

     $broken_navigation = $navigation;

     $navigation = new navigationHistory;

     $navigation->unserialize($broken_navigation);

   }

 } else {

   tep_session_register('navigation');

   $navigation = new navigationHistory;

 }

 $navigation->add_current_page();

 

Bold faced line is line with the error. Can anyone give me an idea as to how to fix this problem? Thanks very much.

Link to comment
Share on other sites

When I left line 285 the way it was I was getting an error. Server could not find path "catalog/includes/languages/.php" which led me to believe that $language was not inputing a value. When I manually put in english.php it fixed this problem (I had this problem on both catalog and admin. . .admin now works just fine with this fix). If you can think of a better way to get around the previous error I received that would be great. Thanks.

Link to comment
Share on other sites

  • 7 months later...

After wresting briefly with this problem, I found the solution. The problem is that in some configurations (at least mine), the navigation history section in "application_top.php" doesn't catch the possibility that the session "navigation" variable is registered and the PHP version running is 4 or above. I'm really not quite sure what caused this huge oversight on the part of the developers (with all due respect).

 

Change the nagivation history chunk of code to read:

 

// navigation history
 if (tep_session_is_registered('navigation')) {
   if (PHP_VERSION < 4) {
     $broken_navigation = $navigation;
     $navigation = new navigationHistory;
     $navigation->unserialize($broken_navigation);
   } else {
	 $navigation = new navigationHistory;
 }
 } else {
   tep_session_register('navigation');
   $navigation = new navigationHistory;
 }
 $navigation->add_current_page();

 

and it should work just fine.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...