Download & Extend

Bad handling of hook_add_to_cart results

Project:Ubercart AJAX Cart
Version:6.x-1.0-rc9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Using Ubercart 2.x. This module doesn't appear to discern whether or not an implementation of hook_add_to_cart in another module returns TRUE and thus let the product be added.

Compare with uc_cart.module handling of results at line 1308.

Comments

#1

Sorry i have the same check like uc_cart

is_array($result) && !empty($result)

is the same like

is_array($result) && count($result) > 0

Do you have an example for me ?

#2

Sorry I should have been more descriptive.

If $result['success'] is set to TRUE in the return results, uc_ajax_cart pops up a blank message and the item isn't added to the cart. The check to see if there's any return arguments is only the beginning. There can be return arguments that allow a product to get added to a cart. Note also the behavior expected if $result['silent'] is set.

Look at uc_cart.module where it checks success value (and after that silent value).

1308       if ($row['success'] === FALSE) {

#3

Thanks, will be in next version ( next week ).

#4

Corrected in 1.0

#5

Status:active» fixed

- fixed

#6

Status:fixed» closed (fixed)

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