module dependency violation?

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

enable store module only, go to administer store, customers
Fatal error: Call to undefined function uc_order_status_list() in ...\sites\all\modules\ubercart\uc_store\uc_store.module on line 669

You must enable Order (Ubercart - core) module to get rid of the error

5.x-1.0-alpha8

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: module dependency violation?

Good catch... it's not really expected for someone to run a store w/o the core modules enabled, but I'll either tweak that code or add a dependency to the .info file so this doesn't happen.

pasqualle@drupal.org's picture
Offline
Joined: 12/02/2007
Juice: 31
fixed
Assigned to:Ryan» pasqualle@drupal.org

This seems to be fixed in beta1.

pasqualle@drupal.org's picture
Offline
Joined: 12/02/2007
Juice: 31
but not completely fixed

same problem on page admin/store/customers/search if you click the search button

Fatal error: Call to undefined function uc_order_status_list()

pasqualle@drupal.org's picture
Offline
Joined: 12/02/2007
Juice: 31
and running cron job

* user warning: Table 'drupal5.uc_orders' doesn't exist query: SELECT COUNT(DISTINCT o.order_id) AS orders, SUM(o.order_total) AS sales FROM uc_orders AS o WHERE o.order_status = 'completed' GROUP BY o.order_status in ...\drupal-5.6\includes\database.mysql.inc on line 172.
* user warning: Table 'drupal5.uc_order_products' doesn't exist query: SELECT SUM(op.qty) AS products FROM uc_order_products AS op LEFT JOIN uc_orders AS o ON op.order_id = o.order_id WHERE o.order_status = 'completed' GROUP BY o.order_status in ...\includes\database.mysql.inc on line 172.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: and running cron job
Assigned to:pasqualle@drupal.org» Ryan

Interesting... here again, a customer is defined in Ubercart as someone who has placed orders, so anything dealing w/ customers is going to crap out. It would be best to solve this without creating circular dependencies (uc_store requires uc_order requires uc_store requires ... ). At the moment, I don't have the time to go through and add in a bunch of module_exists() checks.

I'm a little curious to know if you're running into this in a real world situation (enabling store w/o orders) or if it's just some deep bug hunting for us. Smiling

pasqualle@drupal.org's picture
Offline
Joined: 12/02/2007
Juice: 31
bug hunting
Assigned to:Ryan» pasqualle@drupal.org

no it is not a real world situation, yet. I just trying to use minimal set of modules to display products without the possibility of buying them. It should require max 5 modules from ubercart.

pasqualle@drupal.org's picture
Offline
Joined: 12/02/2007
Juice: 31
modules_exists

hooks? if the module requires other module try using hooks instead of using module_exists() in dependant module. Do not mix functionality. I know you know, just a reminder..

The usage of module_exists function in ubercart is more than double of drupal core!