Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Application_top.php


naturalzing

Recommended Posts

It figures hours before I am supposed to go on vacation an error start appearing after running my site for a few months with no problems.

 

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

 

Is this a hoster fixable problem. Where is the PHP.ini?

 

This link fails

http://www.naturalzing.com/catalog/index.php

 

But other pages work. Admin works fine.

 

Sometimes the session id appears

http://www.naturalzing.com/catalog/index.p...558b1a428a52324

 

And sometimes not

http://www.naturalzing.com/catalog/index.php?cPath=21

 

THanks ALL!

Link to comment
Share on other sites

  • 4 months 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

  • 1 year 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.

 

I don't think that quite does it. I know this is an old post so this may no longer be relevant, but I just started having this problem when I upgraded to PHP 5.

 

Your solution keeps it from breaking, but it also destroys the purpose of the navigationHistory object. You're re-creating it on every page, which means you no longer have a navigation history, except for the history of the 1 page you're on. The idea is to get the navigation history object out of the session (except the first time), and only FIX it if PHP version is < 4.

 

Here's what I tried, which seems to work:

 

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

 

I'm not sure why it's necessary to unserialize the object, but it fixes the problem, and maintains the nav history correctly, so I'm going with it for now...

 

Couple other problems I've had (so far):

 

In admin/includes/classes/upload.php:

commented out line:

$this = null;

(php 5 can no longer re-assign $this directly)

 

In .htaccess, changed

FROM:

<IfModule mod_php4.c>

php_value session.auto_start 0

</IfModule>

TO:

<IfModule mod_php4.c>

php_value session.auto_start 0

</IfModule>

<IfModule mod_php5.c>

php_value session.auto_start 0

</IfModule>

 

I hope it's going to work now... Anybody seen any other probs?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...