Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
When the user has a address book entry and wants to enter a new billing address, the "billing same as shipping" checkbox gets checked on switching to "+ Enter new address".
Solution
TBD.
Comment | File | Size | Author |
---|---|---|---|
#16 | billing_same_as_shi-3119449-16.patch | 2.05 KB | mglaman |
| |||
#15 | 3119449-15.patch | 892 bytes | mglaman |
#15 | Screen Shot 2020-06-15 at 3.25.12 PM.png | 122.23 KB | mglaman |
#7 | 3119449-7.patch | 2.28 KB | flocondetoile |
#5 | 3119449-5.patch | 1.15 KB | flocondetoile |
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 CreditAttribution: jsacksick at Centarro commentedThis is weird! I've been trying to reproduce this manually and I couldn't so far.
Comment #11
jsacksick CreditAttribution: jsacksick at Centarro 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 CreditAttribution: 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_address
property 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.