Ubercart must not use hook_add_to_cart() - Change to hook_ubercart_add_to_cart() (and namespace any other hooks)
rfay - July 4, 2009 - 22:16
| Project: | Ubercart |
| Version: | 6.x-2.0-rc3 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
The accepted behaviors for contrib modules is that they have to namespace their hooks. Thus, ubercart should be using hook_ubercart_add_to_cart as a hook, not hook_add_to_cart.
There are other carts in Drupal... There are other "add to cart" modules. There are other functions called add_to_cart(). It's important to change all hooks to include the ubercart namespace.
This problem was responsible for #494304: Add to Ubercart Cart creates Amazon Cart error messages in Amazon Store module. Amazon store had an innocent amazon_store_add_to_cart() function, which unfortunately got called when Ubercart did an add to cart.
Thanks,
-Randy

#1
This got postponed last time I tried...
#2
This raises its ugly head again in #611044: Fatal error: Unsupported operand types in .../uc_order.module on line 1459. Changing to critical.