Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Unknown()


tetros

Recommended Posts

Hi,

After successful installation I can see first main page and when I click something more i.e. "categories" it appear:

 

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 /all_path/www/catalog/includes/application_top.php on line 309

 

How can I resolve this problem? ...maybe you need more informations?

 

TIA

 

tetros

Link to comment
Share on other sites

are you storing sessions in files? or in the database?

check your configure.php file, the last line, if it is 'mysql' then remove that part, as some servers for some reason dont like storing sessions on the database.

Link to comment
Share on other sites

At the beginning I strored sessions in database but after error I changed it to file and it's this same error appears. I saw that it didn't make any files in /tmp its chmod is 777.

One more thing, at the index page there is a warrning: Parametr session.auto_start is activated... I don't have access to php.ini.

What should I do?

 

TIA

tetros

Link to comment
Share on other sites

  • 2 weeks later...

I think I found the reason of that error...

I have session.auto_start swiched on.

I don't have access to the php.ini, so I tried ini_set('session.auto_start','0'); on the begining of application_top.php file.

But it's still not working....

 

 

regards, tetros

Link to comment
Share on other sites

  • 4 weeks later...

I am experiencing the same problem.

 

In the application_top.php file, I commented out $navigation->add_current_page(); at line 309 and it seem to be working now.

 

BUT...

 

I still have the:

Warning: session.auto_start is enabled
showing

 

One down, one to go...

 

 

Soundgroove

Link to comment
Share on other sites

  • 3 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:

 

<code>

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

</code>

 

and it should work just fine.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 1 month later...

Well, I'm not sure, if I got a different version (2.2 ms2 without any CVS updates), but if I change the navigation history to handle registered sessions for PHP > 4, the nav history doesn't work anymore - i.e. clicking on myAccount doesn't redirect me to myAccount after entering email and password. Same, of course, with any other redirection of that sort.

Link to comment
Share on other sites

  • 6 months later...
Well, I'm not sure, if I got a different version (2.2 ms2 without any CVS updates), but if I change the navigation history to handle registered sessions for PHP > 4, the nav history doesn't work anymore - i.e. clicking on myAccount doesn't redirect me to myAccount after entering email and password. Same, of course, with any other redirection of that sort.

Yes, it seems to me that what this fix does, is declare a brand new empty object for $navigation every time you go to a new page, which isn't the idea, of course. :-)

 

As I read it, the original code says: "If the session is already registered, then fix problems with an old version of PHP if necessary; otherwise, register the session. Now add the current page to the navigation history." If you add in a new declaration for $navigation to handle the case when the session is already registered, you throw away all the navigation history.

 

It seems fairly clear from forum threads on this topic and the bug report that the problem lies with session.auto_start. I've contacted my hosting provider to see what's changed on their end, but in the meantime, not being able to work productively on my store, here I am in the Forums :-).

Grayson Morris

Link to comment
Share on other sites

  • 4 weeks later...

I think Grayson is right about the // navigation history section in the application_top.php. One of the difficulties I ran into when testing the above suggested work around was that when I tried to log in I got a white screen with my name and email address on it. Secondly, it became impossible to add any products whatsoever to my shopping cart. Thank you for the help, all the same.

 

---

 

MY QUESTION: I am trying to restrict access to all pages of the osCommerce site. I have a client that is running a private corporate store that they would not want to compete with their national retailers. So we are trying to make it so that you have to login to the site and then use osC as it normally functions. We still want customers to login (again) as you normally do to purchase something. In this way we want to have a simple username password sitewide entry and then the osC login for individual purchases.

 

I have the sitewide working fine until I go to checkout or login to the osC catalog pages that require a login. Then I get this message:

 

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 /hsphere/local/home/barringt/cellstar.barringtongifts.com/catalog/includes/application_top.php on line 352

 

Line 352 is marked with *** below:

 

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

 

I am using Dreamweaver to do much of the work - thinking it would be quicker - and DW uses session variables to do the access restrictions. There seems to be a conflict of somekind along these lines and I wondered if anyone had any ideas about the best way to proceed?

 

Thanks much for your help.

Link to comment
Share on other sites

  • 11 months later...

Any updates on this issue? I am now recieving this error for some reason but can't seem to figure it out. I tried the above fix and it does work in the sense that it creates a new navigation history but that messes other things up. Anyone have any ideas?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...