Closed (fixed)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Payment
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2013 at 01:41 UTC
Updated:
17 Jul 2013 at 19:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
citlacom commentedHere is the solution I suggest.
Comment #3
rszrama commentedI don't generally like to use $form_state['input'] if I can avoid it. We use #limit_validation_errors when the country select list is changed, and that means the value in $form_state['input'] may actually be a non-existent payment method. I'm not certain someone could use that to their advantage, but I'd rather not give 'em the chance; it doesn't appear our validate handler does any check to make sure the payment method value is an "allowed" value, for example.
The attached patch seems to address the problem, though, by first looking in the validated values array and if nothing is found looking to see if there is a payment method value in the input array. If so, we use the #default_value from the $form_state['complete form'], which at this point in time would be the last rendered selection. In testing, it appears to have solved the reported issue and doesn't seem to cause any regression.
Comment #4
rszrama commentedCommitting that.