Closed (fixed)
Project:
Commerce Shipping
Version:
8.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2020 at 16:40 UTC
Updated:
14 Jul 2020 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
flocondetoileSame bug here. Any advices ?
Comment #3
flocondetoileLooks like when selecting "+ Enter new address", the ajax refresh send a $user_imput which doesn't have the copy_field input
and so in ProfileFieldCopy.php, line 83
We fallback to the default value $enabled set as TRUE because
$user_input['copy_fields']is not set.Comment #4
flocondetoileNote: this bug doesn't appears if we go to the review step (with new address selected and the copy_fields[enable] unchecked again) and go back on the order_information step.
Comment #5
flocondetoileTrying to demonstrate the bug with a failing test. Switching to Need review to trigger the bot.
Comment #7
flocondetoilePatch with a fix.
Comment #9
flocondetoileNew failing test pass (is green now), but we have then an error on another test about
Confirm that the copy_fields checkbox is still checked after selecting a different payment option ("Credit card", in this case).. Anyone with a project with some payment methods to debug this ?Comment #10
jsacksick commentedThis is weird! I've been trying to reproduce this manually and I couldn't so far.
Comment #11
jsacksick commentedActually, I misunderstood the bug in the first place, I managed to reproduce the bug and the test demonstrates it, but not 100% sure about the fix.
Comment #12
dgDatpasst commentedHi, same error here, patch is working for me, thanks
Comment #13
mglamanI think the bug I reported in #3151842: Cannot use a new address, if other addresses exist, when billing is not the same as shipping is this, actually.
Comment #14
mglamanI'm going to assume part of the problem is stale user input values
Comment #15
mglamanOkay, I think I found the logic problem.
We default to copying for new profiles by default, but this doesn't account for the fact the user may be choosing a new profile and not entering without an existing saved profile. Instead of checking if there were other eligible profiles, we can check if the
select_addressproperty exists in the user input.The fix is:
It feels a bit messy, though. I wonder if it can be condensed at all.
Comment #16
mglamanForgot to include tests from #7
Comment #18
mglamanThis has passed QA of a launched site. Committed! Thanks, all.