Unable to edit coupon details after the coupon has been used.

j_ten_man - July 22, 2009 - 14:58
Project:Ubercart Discount Coupons
Version:6.x-1.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Once a coupon has been used, you cannot edit the details of the coupon. The reason for this has to do with the fact that the field where the coupon code goes is disabled once the coupon has been used and the field is required. However, disabled fields are not submitted when a form is submitted and so you get the error "Coupon code field is required.".

I am not sure the best solution for this problem. A couple of options are:

- Don't disable the field, and then in the validation function, simply replace the coupon code with the already saved coupon code code if necessary.
- If you disable the field, also make it non-required. Then once again in the validation function put the coupon code into the correct place.

AttachmentSize
Error screenshot4.17 KB

#1

j_ten_man - July 22, 2009 - 15:24

Here is a patch that I created. Pretty simple and straightforward. I went with the second option, but really there is almost no difference between the two options in how they are implemented. This is against the 6.x-1.2 version.

AttachmentSize
uc_coupon.patch 1.25 KB

#2

longwave - July 23, 2009 - 11:50

Thanks for the report and patch. I've modified your patch to handle used bulk coupons correctly and committed it to CVS.

#3

longwave - July 23, 2009 - 11:59
Status:active» fixed

A similar fix has also been committed to the 5.x branch.

#4

canuckistani - July 29, 2009 - 00:34

*bump* Any interest in rolling a release to address this issue? It greatly impedes functionality ( although I'm fine with the patch for now )

#5

longwave - July 30, 2009 - 12:06

6.x-1.3 and 5.x-1.11 will be available shortly which include the fix for this issue.

#6

System Message - August 13, 2009 - 12:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.