Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

$navigaion problems


fugmulch

Recommended Posts

I am not sure what happened, and believe that my host may have done something.

 

Last week my site worked great, now I get fatal errors all over the place, and they all are related to the $navigation variable. I fixed the first one in application_top.php by removing it from the code, but now my shopping cart and login crash with fatal errors.

 

Not sure where to start looking for help, I emailed my host support to see if something changed on their side. I am looking for info on how this is used, where it is controled from and what I can do to fix it, but so far it seems to be beyond my meager skills....

 

Thanks in advance

 

Scott

Link to comment
Share on other sites

the error in application_top occurs in this batch of 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();

 

and the error is:

Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>navigationhistory</b> of the object you are trying to operate on was loaded _before_ the session was started in /home/elements/public_html/catalog/includes/application_top.php on line 309

 

line 309 is: $navigation->add_current_page();

, php is version 4.3.2

Link to comment
Share on other sites

The problem does not appear to lie with you, but with your hosting company. This piece of code

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

says 'if php version is less than 4'

osCommerce requires php 4+ to be able to work. However, I can't imaine that your host downgraded from php4+ to an older version. Have they changed operating systems? If you're on a Linux server running on RedHat maybe they've upgraded to RedHat Enterprise or changed over to RedHat Fedora - as the old RedHat is being phased out. Red Hat Enterprise is certainly causing problems for people. Check with your host, keep pestering them until you find out what it is that they have changed! Vger

Link to comment
Share on other sites

My host is running php 4.3.2 (from the system info page):

 

Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.2 FrontPage/5.0.2.2634 mod_ssl/2.8.16 OpenSSL/0.9.6b

PHP Version: 4.3.2 (Zend: 1.3.0)

 

They also insist that nothing has changed on their end, and that it has nothing to do with them. They insist that it is in the php code, but this is the stock oscommerce install with the STS mod.

 

Just strange and frustrating, the site worked, then didnt, then worked again and is back to not working now. Gleaning small bits of information little by little, but don't know what to do with it. For instance, if I refuse the PHPSESSIONID cookie when first entering the shop I can reload the opening page forever, but the second I go to another page i get the fatal error again.

 

Perhaps if I edit that code block to take out the if, knowing that I am on 4.3.2?

Link to comment
Share on other sites

  • 4 weeks later...

After wresting briefly with this problem, I found the solution. The problem is that in some configurations (at least mine), the navigation history section in "application_top.php" doesn't catch the possibility that the session "navigation" variable is registered and the PHP version running is 4 or above. I'm really not quite sure what caused this huge oversight on the part of the developers (with all due respect).

 

Change the nagivation history chunk of code to read:

 

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

 

and it should work just fine.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...