osCommerce Fatal Error: Call to member function add_current_page() on a non-object

I received an osCommerce fatal error after installing it. I used osCommerce Online Merchant v2.2 RCa. This is the error:

osCommerce installation fatal error: call to member function add_current_page

osCommerce installation fatal error: call to member function add_current_page

Fatal error: Call to a member function add_current_page() on a non-object in [absolute path to]/public_html/ultratrust/asset-protection-book/includes/application_top.php on line 312

I received the resolution to this problem from this osCommerce forum here:

http://forums.oscommerce.com/topic/168369-call-to-member-function-or-a-non-object/page__p__724964&#entry724964

In a nutshell just change line 307 (or thereabouts) and add this line for the file called application_top.php which is located at /catalog/includes/:

else {
        $navigation = new navigationHistory;
    }

immediately after this part:

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

OR simply change these lines:

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

which starts at line 302 in my version of osCommerce Online Merchant v2.2 RCa.

That above part should be changed to:

// 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(); 
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Share

You must be logged in to post a comment.