Ubercart Setup PHP Error

Posts: 2
Joined: 12/22/2008

I just installed Ubercart on my Drupal site and am getting a PHP error:

[21-Dec-2008 13:30:21] PHP Fatal error: Call to undefined function uc_order_state_default() in ...ubercart/payment/uc_credit/uc_credit.module on line 193

Has anyone else experienced this error? It seems the function is defined in uc_order/uc_order.module.

Any help would be greatly appreciated.

-Mark

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Sounds like the order module might not be enabled for some reason. Puzzled

What version did you install, and can you verify that the order module is actually enabled?

Posts: 2
Joined: 12/22/2008

I installed version 5.x-1.6. Also, in the administration panel under Ubercart-core the order module is enabled and other modules that depend on the order module say order is enabled... I even see the declaration of the function in the order module.

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Could it be you have more than one version of the module installed? I'm not really sure what to tell you if you can't sort it out yourself... I doubt this is a reproducible error.

Posts: 18
Joined: 01/10/2008

I am having the same problem on one of the sites I manage.

A lot of the sales go through, but occasionally the same error as posted above is thrown for me.

There is only one copy of ubercart installed. uc_order_state_default() is declared where it should be.

Posts: 18
Joined: 01/10/2008

Just bumping this again.

Even with UC 1.7, I am still getting these errors. 90% of the time, the store works perfectly. However, when these errors trigger, someone on the site is getting a WSOD while trying to check out.

We can't reproduce it here. But these errors are populating our logs.

[Tue Apr 28 12:44:43 2009] [error] [client XX.XXX.X.XX] PHP Fatal error:  Call to undefined function uc_order_state_default() in /home/sites/xxxxxxxxx.com/www/pages/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 193

http://www.brianvuyk.com

Posts: 6997
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

That function sits in uc_order.module, so you might look for some reason for that module to not get loaded or for an older version of it to come up... could it be a memory limit thing?

Posts: 18
Joined: 01/10/2008

Thanks for the reply, Ryan.

There are no older versions of this module installed. A quick grep of the /sites shows only one declaration of uc_order_state_default:

-bash-3.1$ grep -iRnH 'function uc_order_state_default' ./sites/
./sites/all/modules/ubercart/uc_order/uc_order.module:3059:function uc_order_state_default($state_id) {
-bash-3.1$

What other reasons could there be for this function to not be available randomly? This only happens periodically. Most sales go through without triggering this.

Posts: 18
Joined: 01/10/2008

One further thing I just realized,

This isn't only during checkouts, as some of these errors have referrers from external sites such as Google:

[Tue Apr 28 21:17:03 2009] [error] [client 67.78.57.216] PHP Fatal error:  Call to undefined function uc_order_state_default() in /home/sites/bloodshotrecords.com/www/pages/sites/all/modules/ubercart/payment/uc_credit/uc_credit.module on line 193, referer: http://www.google.com/search?hl=en&q=Subject+of+the+site+&aq=f&oq=

The query leads to a node that is just a regular CCK type, not part of the store. I can't get the message to trigger by following the link myself, but it's happened for other people on this link, as well as several dozen others.

Posts: 3
Joined: 12/02/2008

Hi Brian,

I'm getting reports that people are seeing similar messages on my website as well, but I can't reproduce it either. Did you find a fix to this?

Thanks!
Tarun

www.bombayhustle.com