Closed mattstein closed 2 years ago
Thanks @mattstein !
This was a good little two-part issue.
First, it turns out the logic for selecting an address had been moved out of the currentUser and addresses|length
conditional. This means the address selection list was showing when it shouldn't have been for guest users. It does mean that we had to wave goodbye to the shrugging man ( ¯\_(ツ)_/¯
).
Secondly, after making that change the problem you stated still existed for logged in users. Looking into this I think something has changed when it comes to encoding sprig attributes. There were two s-val
we were passing data
and type
. Passing these individually causes a double encoding bug, primarily on data
as this is already a JSON encoded string. Making the following change seems to fix the issue.
// Before
s-val:data='{{ data|json_encode }}'
s-val:type='{{ type }}'
// After
s-vals='{{ {data: data, type: type}|json_encode }}'
Have pushed these changes up to the stable branch. Will now look at merging them into the Craft 4 version.
Description
On both demo versions (3.x and 4.x), a JSON error interrupts the process of saving a new address at
/checkout/address
. The submitted address does get saved, but you’ll be stuck with the Ajax waiting animation and need to do a hard refresh to see it:Steps to reproduce
Bonus: refresh and your new address will be there.
Additional info
Bugsnag 4.x: https://app.bugsnag.com/pixel-and-tonic-inc/demos?i=sk&m=oc (not seeing a Bugsnag alert for 3.x despite the same behavior)