I am getting the following error:

Fatal error: Call to undefined function uc_order_customer_orders() in /home/username/public_html/sites/all/modules/uc_civicrm/uc_civicrm.module on line 84

The error shows up as follows:

  • Install CiviCRM and Ubercart and UC-CiviCRM
  • A person buys something in the store
  • Contribution shows up in CiviCRM and I can view the contribution, and edit the new contact.
  • When I try to view the contact, however, I get the error. (If I edit the contact and then save it, I get the error when it tries to load the contact view.)

Line 83-84 of uc_civicrm.module:

 module_load_include('inc', 'uc_order', 'uc_order.customers');
  $output = uc_order_customer_orders($uid);

Comments

dharmatech’s picture

Do you have the uc_order module enabled?

laryn’s picture

Yes, I had checked that already:

[~/public_html]# drush en uc_order
uc_order is already enabled.       [ok]
There were no extensions that could be enabled.    

At the moment I've just commented out line 84, which truncates the functionality I'm sure, but I don't get the errors any more. (The purchases tab is greyed out in the contact view).

dharmatech’s picture

What version of Ubercart do you have installed?

dharmatech’s picture

Looks like things have changed w/Ubercart... they've (again) changed how to get customer order information. If you want to dig into it a bit and take a stab at a patch, I can help you get this issue fixed.

laryn’s picture

Assigned: Unassigned » laryn

Okay, I'll give it a shot.

dharmatech’s picture

Let me know if you get stuck. Civi renders an HTML snippet when someone clicks the tab in the contact record. So the code needs to know a URL to get the snippet and a count to display in the tab (optional). My guess is the Ubercart folks now have an API to get order information.

laryn’s picture

I found out Ubercart replaced this function with a view. What do you recommend? Looks like we could either duplicate the code from the previous UC release and make it part of UC CiviCRM, or use the view they have replaced it with -- although this would require a dependency of UC 7.0-rc3+

Reference: http://drupal.org/node/1372106

dharmatech’s picture

Thanks for looking into it. Ideally we'd have an API to work with but since we don't, I vote to pull in the old uc_order_customer_orders() code. I took a quick look and it seems like it should drop right in... we can remove the call to load the .js file.

Do you want me to generate the patch or do you want to? As soon as we have a tested patch, I'll pull it in and do a new release.

laryn’s picture

Status: Active » Needs review
StatusFileSize
new3.51 KB

Here's my attempt at a patch. First ever.

dharmatech’s picture

Thanks again laryn. I used your patch and also removed the module_load_include() call. Seems to test out ok so I pushed the changes to -dev branch. If you want to verify it works for you in -dev, I'll create a new stable release.

You can pull from git or wait ~24 hours for a new tarball.

laryn’s picture

Status: Needs review » Reviewed & tested by the community

Latest -dev works for me.

dharmatech’s picture

Status: Reviewed & tested by the community » Fixed

Great. I tagged a new 7.x-1.1 release and it should show up on the project page shortly.

Thanks again for your help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.