Jump to content

Archived

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

Sisconetto

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

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)

}

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

check the catalog\includes\classes\navigation_history.php vs the default file from osc. Have you done mods there?

Share this post


Link to post
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();

Share this post


Link to post
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();

 

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

Share this post


Link to post
Share on other sites
Just to follow the above code, it works when i had similiar error.

 

I had a similiar error also that just randomly came up and this fixed it THANKS! Someone should bug report this so they can fix it in future releases.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Thanks, it worked for me too!! But I'm still curious why it came up with this message? Didn't change al lot lately.

Share this post


Link to post
Share on other sites
Thanks, it worked for me too!! But I'm still curious why it came up with this message? Didn't change al lot lately.

 

I suppose that your Host upgraded PHP to Version 5

Share this post


Link to post
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 was getting the error with Firefox 3 and not IE. I changed this file and it works for both now. Thanks

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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();

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

 

Thanks

Jack


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

Share this post


Link to post
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();

 

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.

Share this post


Link to post
Share on other sites
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!!


Heather...

 

icon_baby_crawl-1.gifCrawling my way through pages of code with my fingers crossed and one eye on here. Grateful to many at the osCommerce Community. Thank YOU

 

Coding successes: GV & Coupons, UltraPics, FCK Editor, Product Listings Enhancement, Short Descriptions, Define Main Page, Text Box, Attribute Sets Plus, . PayPal WPP. UL Catagories. Dynamenu. Featured Products. Mailist Report 1.2. Easy Meta Tags (Now even I could have screwed that up) Sold Out but Displayed 0.3. Club osc Specials on Front Page. Order Editor. HTML Emails V2

Working on: SEO

 

 

Proud member of the Code Breakers Club

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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();

 

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!

Share this post


Link to post
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

Share this post


Link to post
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:

CODE

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

etc...

 

 

This worked for me. Thanks.

Share this post


Link to post
Share on other sites

I had EXACTLY the same problem last night! About 3 hours before this happened, I had installed Google Checkout...

 

the strange thing is... i didn't change anything at all and it fixed it's self!!! Bizzaree!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×