Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

application_top.php


SofieVT

Recommended Posts

I have been browsing around a few days to find a sollution to a given error:

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/httpd/members/sporterra/shop/includes/application_top.php on line 312

 

So far i had however no luck in finding out what might have gone wrong.

I did not modified this file.

 

The block of code the error referrs to:

 

// 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();

// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {

 

Anyone maybe out there who had the same trouble or who can help me out on this one?

It would be MUCH appriciated!

Link to comment
Share on other sites

Fatal error: Call to a member function add_current_page() on a non-object in /home/httpd/members/sporterra/shop/includes/application_top.php on line 312

 

So far i had however no luck in finding out what might have gone wrong.

The error points to the fact that the object $navigation (called with $navigation = new navigationHistory) does not exist.

 

You could try changing the first line to:

// navigation history
 if (isset($_SESSION['navigation'])) {
// version 3 of PHP is only found in museums nowadays :-)
/*	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();

// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {

Link to comment
Share on other sites

Parse error: syntax error, unexpected $end in /home/httpd/members/sporterra/shop/includes/application_top.php on line 512

 

This is the result of the code you suggested but i got a good feeling that i am moving into the good direction with this! :)

I take that it must be some kind of { } or something now cause 512 is really the end of the file.

Link to comment
Share on other sites

Parse error: syntax error, unexpected $end in /home/httpd/members/sporterra/shop/includes/application_top.php on line 512

 

This is the result of the code you suggested but i got a good feeling that i am moving into the good direction with this! :)

I take that it must be some kind of { } or something now cause 512 is really the end of the file.

Maybe just change the first line: if (isset($_SESSION['navigation'])) {. The part I commented out is just a waste of time to make the code go through, but in itself harmless.

Link to comment
Share on other sites

Okey .. my block of code looks like this now:

 

// navigation history
 if (isset($_SESSION['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();

 

But that gives me the same error:

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/httpd/members/sporterra/shop/includes/application_top.php on line 312

 

So far thank you for the help JanZ! :)

Link to comment
Share on other sites

Okey .. my block of code looks like this now:But that gives me the same error:

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/httpd/members/sporterra/shop/includes/application_top.php on line 312

That object is instantiated with the $navigation = new navigationHistory; line. The class needed for that is loaded around line 131 in includes/application_top.php:

// include navigation history class
 require(DIR_WS_CLASSES . 'navigation_history.php');

When that file would be missing you would have gotten an error message about that before the error message you get now.

 

It would mean that this class is missing that function, meaning the default osC file is not there but something that is now not function anymore. Otherwise I would have no explanation for that.

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

Thank You very much Jan ;)

 

I had this problem and with your help I am on-line.

 

I have used this code as final... in /includes/application_top.php about line 312

 

// navigation history

if (isset($_SESSION['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();

Regards,

Paulo

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...