Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Call to member function or a non-object!!!


Guest

Recommended Posts

Post the entire error message - it will tell us exactly where the eroor is being generated - from that we can suggest a fix.

Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Link to comment
Share on other sites

Post the entire error message - it will tell us exactly where the eroor is being generated - from that we can suggest a fix.

 

Fatal error: Call to a member function on a non-object in D:\website\sisconetto_com\loja_virtual\catalog\includes\application_top.php on line 309

 

application_top.php:

 

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

Link to comment
Share on other sites

  • 1 month later...

Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

Link to comment
Share on other sites

  • 1 year later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

 

Just to follow the above code, it works when i had similiar error.

Link to comment
Share on other sites

  • 7 months later...
it is something referring to the navigation history...

 

anyone?!

 

thx

 

Just FYI. If you use the solution suggested in the posts before, you will loose the navigation history because the object is created again every time. Doing it like this is much better:

 

Replace

if (tep_session_is_registered('navigation')) {

with

if (tep_session_is_registered('navigation') && is_object($navigation)) {

 

 

For some reason on some systems, the session variable is registered on the first object but the object doesn't persist. On my local Windows install it starts persisting after the second call.

HTH

 

Gunter

Link to comment
Share on other sites

  • 2 months later...
Just FYI. If you use the solution suggested in the posts before, you will loose the navigation history because the object is created again every time. Doing it like this is much better:

 

Replace

if (tep_session_is_registered('navigation')) {

with

if (tep_session_is_registered('navigation') && is_object($navigation)) {

For some reason on some systems, the session variable is registered on the first object but the object doesn't persist. On my local Windows install it starts persisting after the second call.

HTH

 

Gunter

 

THANKS VERY MUCH,I DID IT.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

I was getting the error with Firefox 3 and not IE. I changed this file and it works for both now. Thanks

Link to comment
Share on other sites

Its an issue related to session variables being treated as globals.

 

$navigation = new navigationHistory;

then $_SESSION['navigation']= $navigation

 

in short do not assume $_SESSION['navigation'] and $navigation to be same.

 

 

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.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I'm having the same error.

 

I have replaced the code's like they are discribed here but still the same error.

 

Can someone help me out?

 

Greetz

Lili

Link to comment
Share on other sites

  • 1 month later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

Just to say this worked for me when I was getting error.

 

Thanks

Jack

If at first you don't succeed.............................Cheat!!

Link to comment
Share on other sites

  • 2 weeks later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

 

My host is running PHP Version 5.2.6 - I've tried updating the reference from Version 4 to Version 5 and 5.2.6. I get this error:

Fatal error: Call to undefined function tep_output_string() in /home/voincon/public_html/playground/includes/functions/html_output.php on line 81

 

Line 81 has: include(DIR_WS_FUNCTIONS . 'gzip_compression.php');

 

The complete section is:

// if gzip_compression is enabled, start to buffer the output

if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {

if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {

if (PHP_VERSION >= '4.0.4') {

ob_start('ob_gzhandler');

} else {

include(DIR_WS_FUNCTIONS . 'gzip_compression.php');

ob_start();

ob_implicit_flush();

}

} else {

ini_set('zlib.output_compression_level', GZIP_LEVEL);

}

}

 

I tried changing the version from 4.0.4 to 5.2.5 and just 5 - still get the same line 81 error... STUMPED.

Link to comment
Share on other sites

  • 3 weeks later...
Just FYI. If you use the solution suggested in the posts before, you will loose the navigation history because the object is created again every time. Doing it like this is much better:

 

Replace

if (tep_session_is_registered('navigation')) {

with

if (tep_session_is_registered('navigation') && is_object($navigation)) {

 

 

For some reason on some systems, the session variable is registered on the first object but the object doesn't persist. On my local Windows install it starts persisting after the second call.

HTH

 

Gunter

 

Worked for me too, thanks so much, having another error to add to my list was draining my will to live!!

Link to comment
Share on other sites

  • 4 weeks later...
Worked for me too, thanks so much, having another error to add to my list was draining my will to live!!

 

I had the same problem replaced the code added FYI code and it also works.

 

I did hower examin the cod I replaces and can't see any diffrence.

New code

// navigation history

if (tep_session_is_registered('navigation') && is_object($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;

}

old code I added comited out the old code.

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

// }

 

I was adding the Wishlist to my site when this error started. and added the fallowing below below this code

 

// wishlist data

if(!tep_session_is_registered('wishList')) {

tep_session_register('wishList');

$wishList = new wishlist;

}

//Wishlist actions (must be before shopping cart actions)

if(isset($HTTP_POST_VARS['wishlist_x'])) {

if(isset($HTTP_POST_VARS['products_id'])) {

if(isset($HTTP_POST_VARS['id'])) {

$attributes_id = $HTTP_POST_VARS['id']; tep_session_register('attributes_id');

}

$wishlist_id = $HTTP_POST_VARS['products_id'];

tep_session_register('wishlist_id');

} tep_redirect(tep_href_link(FILENAME_WISHLIST));

}

 

 

I am using bluefish for the editor as the Admin edit function will not save the changes I made to the files. Is PHP more sensitive to white space etc than Perl?

Link to comment
Share on other sites

  • 4 weeks later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

 

Thank you, i had same problem and this code seems to fix it so far, i still have a lot to test. I also added code from duhy, seemes to be working just fine.

Thank you both!

Link to comment
Share on other sites

Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

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

 

Replace it with this

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

I did that, now I get this

Warning: require(includes/languages/english/default.php) [function.require]: failed to open stream: No such file or directory in /home/alex/public_html/oscommerce/index.php on line 33

 

Warning: require(includes/languages/english/default.php) [function.require]: failed to open stream: No such file or directory in /home/alex/public_html/oscommerce/index.php on line 33

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/default.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/alex/public_html/oscommerce/index.php on line 33

Link to comment
Share on other sites

  • 1 month later...
Somehow seems the navigation parameter remains registered so the class is not instantiated. As a test try this:

 

1. Backup catalog\includes\application_top.php then open it locate this code:

CODE

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

etc...

 

 

This worked for me. Thanks.

Link to comment
Share on other sites

  • 4 weeks later...

There are two seperate errors here that seem to be getting confused.

 

1. Call to a member function set_snapshot() on a non-object

 

This can be caused by a bug in application_top fixed by changing navigation history to:

 

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

 

2. Fatal error: Call to a member function add_current_page() on a non-object in /home/mysite/public_html/includes/application_top.php

 

This is most often a browser cache issue, restart browser &/or clear browser cache

 

:)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...