Hi there. Firstly, thanks for such a great set of modules.

I think I've found a little bug. I created an auctioned product with a starting price and then went back in to edit it. Upon saving (with no changes made), validation failed with the message "Starting price field is required".

After looking into the code it seems that the problem arises from a disabled field being required. It seems that if the product is already currently being auctioned, the real starting price field is turned into a value field rather than a textfield. Then in order to display something to the user, this field is duplicated into 'start_price_disp', which is set as a textfield. Doing this means that 'start_price_disp' is still both disabled and required. I therefore fixed the problem by adding in a single line in uc_auction.module so that the (display) field isn't required:

if ($is_curr_auction) {
        $form['base']['auction']['start_price_disp'] = $form['base']['auction']['start_price'];
        $form['base']['auction']['start_price_disp']['#type'] = 'textfield';
        // Addition line below ensures the form can be submitted
        $form['base']['auction']['start_price_disp']['#required'] = FALSE;
}
CommentFileSizeAuthor
#2 uc_auction-starting-price-1677940-2.patch595 bytesLGLC

Comments

LGLC’s picture

I should probably have said that the additional line was added to line 217 (inside uc_auction_form_alter).

LGLC’s picture

Status: Active » Needs review
StatusFileSize
new595 bytes

Patch attached.

zegmant’s picture

The same problem. Thanks, your patch works

oren102’s picture

Perfect.
Thanks for the patch

SeanA’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes