The update button seems to fail. When changing the items from ex. 1 to ex. 4 and hitting the button the page refreshes but the value is still 1.

Just to double check I went to rifftrax.com and the same happens there. Ex. http://www.rifftrax.com/cart

Even tried disabling javascript, just in case there was some interference. That did not fix the problem.

Can someone send me in the right direction to fix this problem?

Thanks
Francois.

Comments

FranCarstens’s picture

I think I might have found it...

When comparing the latest version of uc_cart.module to 6.x-2.2 I found the following difference:

The latest version looks like this:

965 |  $form['update'] = array(
966 |      '#type' => 'submit',
967 |      '#name' => 'update-cart',
968 |      '#value' => t('Update cart'),
969 |    );

The 6.x-2.2 version looks like this:

990 |  $form['update'] = array(
991 |      '#type' => 'submit',
992 |      '#value' => t('Update cart'),
993 |      '#submit' => array('uc_cart_view_form_submit'),
994 |    );

6.x-2.9 is missing the subit value:

'#submit' => array('uc_cart_view_form_submit'),

Adding this line fixed the issue.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

This works for me on a fresh install, and uc_cart_view_form_submit() should be called by default if no submit handler is specified. Perhaps you have a contrib module or custom code that alters this form somehow?

tr’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Active

I cannot reproduce this problem on a clean install of 6.x-2.9.

That #submit was deliberately removed as part of #529110: Users misunderstand "Remove” checkbox on cart page (commit 9a5b54358af9) more than 15 months ago, and there have been no reports of any problems since then.

I do see the described behavior on RiffTrax, but that site is using an old version of Ubercart.

I suggest testing your site with the default Garland theme to see if the problem is theme related. I would also make very sure that you've run all the update functions and cleared your caches - this could perhaps be caused by a failed or incomplete upgrade.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)
FranCarstens’s picture

I will do that and report back. Thanks.

In the meantime, is it okay to leave this line of code in? Of course, not while I'm testing. :D

tr’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Can't reproduce this - feel free to reopen if you can provide steps to reproduce.

tr’s picture

(removing tags added by spammer)