The 2nd variable_get() in commerce_customer_profile_pane_checkout_form_submit() is unnecessary, the variable has already been got.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | commerce-2678718-7-remove_variable_get.patch | 850 bytes | czigor |
| #2 | commerce-2678718-2-remove_variable_get.patch | 736 bytes | czigor |
Comments
Comment #2
czigor commentedComment #3
mglamanWe actually do need this. And I suppose we need to review the tests.
Comment #4
mglamanComment #5
czigor commentedI'm not sure we are talking about the same variable_get(). There are 2 variable_get()s in commerce_customer_profile_pane_checkout_form_submit(). The 2nd one fetches the same variable as the 1st, so it's not needed.
Comment #6
mglamanWhoops O:) I looked at form and not submit, sorry. You are correct.
Beginning of function
And this portion of the patch
What do you think about changing the title a bit and adding this other fix: there's no need to initiate an order wrapped if the field is empty. This is only used if the field name is not empty, so it should be initiated in that same check.
Comment #7
czigor commentedNo wonder, I was using the wrong function name in the title and the description. :|
I have fixed the wrapper thing, too.
Comment #8
mglaman:)
Comment #9
smccabe commentedLooks good to me, both changes are small and don't actually change any functionality, just make things a little cleaner.
Comment #10
rszrama commentedCommitted.