Jump to content



Photo
- - - - -

fatal error: Call to a member function add_current_page() on a non-object in catalog\includes\application_top.php on line 312


This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1   lotjonenjo

lotjonenjo
  • Members
  • 2 posts

Posted 16 February 2008 - 13:10

I get this fatal error:
Fatal error: Call to a member function add_current_page() on a non-object in \htdocs\catalog\includes\application_top.php on line 312

I was trying to set up purchase_without_account mod...
Help please....


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

#2   germ

germ
  • Members
  • 13,921 posts

Posted 16 February 2008 - 14:48

The fix can be found here:

Click Me
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#3   satish

satish
  • Members
  • 5,350 posts

Posted 16 February 2008 - 17:35

should be an issue when register globals is set to off.
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
}
}
replace with
if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
$navigation->unserialize($broken_navigation);
}
$navigation=$_SESSION['navigation'];
}

Satish
Ask/Skype for  Free osCommerce value addon/SEO suggestion tips for your site.

Check My About US For who am I and what My company does.

#4   adamluz

adamluz
  • Members
  • 22 posts

Posted 07 March 2008 - 00:45

Thanks your fix worked for me. /smile.gif' class='bbc_emoticon' alt=':)' />

#5   adamluz

adamluz
  • Members
  • 22 posts

Posted 07 March 2008 - 01:03

Thanks your fix worked for me. /smile.gif' class='bbc_emoticon' alt=':)' />

I take that back... now I am getting an error 500 on checkout_shipping because of this fix. Line 18 calls to $navigation->set_snapshot(); which is what my error_log is reporting as the problem.

#6   thedotcom

thedotcom
  • Members
  • 23 posts

Posted 22 April 2008 - 04:01

My hosting provider decided to upgrade his php to version 5 and turn off globals, and now I am getting the same error.

Ithought that if I overwrite the application_top.php with the version in the latest release, that would fix it, but the navigation history section does not appear anywhere at all not ever near line 125. SO where do I go now?
After it's all said and done....there's more said than done!

#7   thedotcom

thedotcom
  • Members
  • 23 posts

Posted 22 April 2008 - 04:24

Addendum
My hosting provider decided to upgrade his php to version 5 and turn off globals, and now I am getting the same error.

I thought that if I overwrite the application_top.php with the version in the latest release, that would fix it, but now, no products show on any page. visit http://www.cyberlink.net.au/ggl/ to see the effects! and suggestion?
After it's all said and done....there's more said than done!

#8   cyberdesignz

cyberdesignz
  • Members
  • 1 posts

Posted 08 May 2008 - 18:27

Just turn on the register_globals and you are done, there is no other issue at all

#9   thenook

thenook
  • Members
  • 47 posts

Posted 16 May 2008 - 00:11

How do I turn on the register_globals?

#10   Kids Juke Box

Kids Juke Box
  • Members
  • 8 posts

Posted 21 May 2008 - 22:03

How do I turn on the register_globals?


You can turn on register globals through your .htaccess file like this

php_flag register_globals on

----------------------------------
Shean Hoxie
Webmaster- Kids Juke Box
----------------------------------

#11   styljola

styljola
  • Members
  • 1 posts

Posted 06 August 2009 - 12:55

Please help me /blink.gif' class='bbc_emoticon' alt=':blink:' />

Fatal error: Call to a member function add_current_page() on a non-object in .../catalog/includes/application_top.php on line 312

$navigation->add_current_page();



#12   chuckh2d

chuckh2d
  • Members
  • 57 posts

Posted 02 October 2009 - 22:24

I've just been through this myself while uploading Basic Design Pack 2.5. (I'd moved the includes/boxes files that were going to be replaced into a back-up folder... and mistakenly moved one too many!)

The trick is to

(1) delete your website cookies (customer-side: no need to delete admin settings) after you receive the "Fatal error: Call to a member function..." message.
(2) Open your website again (do not refresh) and
(3) the actual error path for the missing file should be displayed, looking something like this:

Warning: require(xxxx/xxxx/xxxx.php) [function.require]: failed to open stream: No such file or directory in /xxxx.../catalog/xxxx.../xxxx.php on line xxx

That line (or lines) in xxxx.php should tell you exactly what's missing. Happy hunting!

-C.