zebraplayer Posted May 14, 2008 Posted May 14, 2008 Hi, I am getting the following error. I searched for the solution to this and found a post of a guy that said he fixed his own same problem, but did not bother to leave a clue as to what he did. This is the error message: Fatal error: Call to a member function set_snapshot() on a non-object in /home/indie853/public_html/charlottefilmfestival/shop2/checkout_shipping.php on line 18 Any help is appreciated. -Lou
Guest Posted June 19, 2008 Posted June 19, 2008 anyone familiar with this, I'm getting it too. Happens to non-members when they hit checkout, rather then going to sign-up page.
pizzasupreme Posted June 20, 2008 Posted June 20, 2008 I found this thread on Google. Funny, I didn't even realize OsCommerce had this forum when I downloaded it. I have made some slight changes to my design, colors and whatnot, but I am running into this same problem. I believe this is part of a bigger issue, because if you search the exact function error on Google, you will find many shops that have it, but probably do not know they do. Ok, I'm ready for some help with this now. What information can I provide?
spooks Posted June 20, 2008 Posted June 20, 2008 This would indicate that the line at the top of checkout_shipping.php has been edited to remove require('includes/application_top.php'); as that includes the require(DIR_WS_CLASSES . 'navigation_history.php'); thats needed. Is that line there? 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.
pizzasupreme Posted June 20, 2008 Posted June 20, 2008 Thank you for such a quick response. Yes, btw, it is there. On other forums they use the quote tags for this, let me know what the procedure is here if incorrect. But here is what I have Released under the GNU General Public License*/ require('includes/application_top.php'); require('includes/classes/http_client.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); }
spooks Posted June 20, 2008 Posted June 20, 2008 Looking through other posts it appears this may occur on upgrade from php4 to 5 where a bug stops the class being instantiated. Making this code change in application top may fix the issue: Find: // 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 With: // 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; } $navigation->add_current_page(); Not my code, just combined from others, let me know if it works. :) 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.
pizzasupreme Posted June 20, 2008 Posted June 20, 2008 Sam Brilliant!! Thank you very much. You know, I've spent hours on this. I'm sure a lot of others will find it useful as well, when their journey leads them here. Harry Shitzele
Guest Posted June 20, 2008 Posted June 20, 2008 wow, i thought this thread was a lost cause. Hell Yea, sam, worked for me too...BIG UPS 4 REAL.
♥FWR Media Posted September 6, 2008 Posted September 6, 2008 Hmm that hack doesn't make sense to me. The original is saying .. If the navigation variable (not object) exists and you have decent version of PHP { // Do nothing } Add the current page to the navigation ################################ The hack is saying .. If the navigation object exists and you have decent version of PHP { //Recreate a new one even though it already exists } Add the current page to the navigation ################################ Wouldn't this mean that the snapshot history is lost? Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted September 6, 2008 Posted September 6, 2008 What about just testing for the object? // 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 { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted September 6, 2008 Posted September 6, 2008 Actually the following would be more correct .. // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } if( false === is_object($navigation) ) { $navigation = new navigationHistory; } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
conledy Posted January 19, 2010 Posted January 19, 2010 Looking through other posts it appears this may occur on upgrade from php4 to 5 where a bug stops the class being instantiated. Making this code change in application top may fix the issue: Find: // 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 With: // 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; } $navigation->add_current_page(); Not my code, just combined from others, let me know if it works. :) I feel so good!thanks!
seshalyn_pr Posted February 26, 2010 Posted February 26, 2010 Looking through other posts it appears this may occur on upgrade from php4 to 5 where a bug stops the class being instantiated. Making this code change in application top may fix the issue: Find: // 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 With: // 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; } $navigation->add_current_page(); Not my code, just combined from others, let me know if it works. :) Hello All, I'm having the same problem, I changed the code to what Sam suggested, but i'm still getting the error :( Any other suggestions?? Thanks so much!!! I Hate PHP, LoLssss Visit My Site, Any constructive comments and suggestions Welcome :) WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS
MrPhil Posted February 26, 2010 Posted February 26, 2010 There is much dispute over the correct fix for this. Try http://www.oscommerce.com/forums/topic/346007-first-post-here-please-help-me/page__view__findpost__p__1444591
seshalyn_pr Posted February 27, 2010 Posted February 27, 2010 There is much dispute over the correct fix for this. Try http://www.oscommerce.com/forums/topic/346007-first-post-here-please-help-me/page__view__findpost__p__1444591 hey Mr. Phil: thanks so much for responding. I did visit the post that you refered to me, I tried all of the fixes!!!, Nothing worked :( . I also tried the advices on this post Click here. No luck either. I'm really exhausted with all of this :wacko: . I've decided to just star all overrrr againnnn. But I just wanted to ask you, or anyone who can help. What may cause this issue??? I read it could be related to the PHP being used. Are their any other causes? how can it be avoided? Stuff like that. Just asking because I would like to avoid or be more precautious about this issue, in the future. Again thanks so much for responding :) I Hate PHP, LoLssss Visit My Site, Any constructive comments and suggestions Welcome :) WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS
MrPhil Posted February 27, 2010 Posted February 27, 2010 So you tried the following and it still fails (add_current_page() member function on non-object)? // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } elseif (!is_object($navigation)) { $navigation = new navigationHistory; } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); Well, it's a coding error in osC. Nothing really to do with PHP, except that possibly some versions may have it show up more easily than other versions. But in the end, the osC code has to be fixed. If your "same problem" is the set_snapshot() error, of course this will not fix it! It's for a different problem!
seshalyn_pr Posted March 1, 2010 Posted March 1, 2010 So you tried the following and it still fails (add_current_page() member function on non-object)? // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } elseif (!is_object($navigation)) { $navigation = new navigationHistory; } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } $navigation->add_current_page(); Well, it's a coding error in osC. Nothing really to do with PHP, except that possibly some versions may have it show up more easily than other versions. But in the end, the osC code has to be fixed. If your "same problem" is the set_snapshot() error, of course this will not fix it! It's for a different problem! Hello: I did try all of the codes offered, unfortunately to no avail. I just started the whole thing over from scratch. I really appreciate your help though!!! Hopefully this will help someone else, researching the topic. Have a good one!!! Once again many many thanks!!! I Hate PHP, LoLssss Visit My Site, Any constructive comments and suggestions Welcome :) WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS
Fhaidel Posted March 17, 2010 Posted March 17, 2010 spooks, you're a hero. it worked perfectly for me. Thank you so much for posting that code. Looking through other posts it appears this may occur on upgrade from php4 to 5 where a bug stops the class being instantiated. Making this code change in application top may fix the issue: Find: // 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 With: // 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; } $navigation->add_current_page(); Not my code, just combined from others, let me know if it works. :)
eveorgan Posted August 2, 2010 Posted August 2, 2010 Looking through other posts it appears this may occur on upgrade from php4 to 5 where a bug stops the class being instantiated. Making this code change in application top may fix the issue: Find: // 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 With: // 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; } $navigation->add_current_page(); Not my code, just combined from others, let me know if it works. :) You're wonderful! I had the same problem and it fixed it immediately, thank you so much, really appreciate it. x
Recommended Posts
Archived
This topic is now archived and is closed to further replies.