magento2: Checkout/view/frontend/web/template/billing-address/details.html tries to join street address fields on undefined value

Preconditions (*)

  1. 2.4.3

Steps to reproduce (*)

  1. reach checkout payment step with billing address missing street fields or street field is not a array

Expected result (*)

  1. no errors displayed , checkout working

Actual result (*)

  1. error logged, all script execution broken

Uncaught TypeError: Unable to process binding "text: function(){return currentBillingAddress().street.join(', ') }"

  1. this is caused in https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html

created with a commit by @rostyslav-hymon on following https://github.com/magento/magento2/commit/53b85cce1e95a5cfb60db6dc029e551d053e1f14#diff-e4dcdf0e20375ec650339c4cc63147ff8156a5eb9d2e82e2927d744599d157b5

  1. was working before on 2.4.2 (p1 and p2 included) so probably a mixup of template edited as the change is completely lost on git history for this specific line : https://github.com/magento/magento2/blob/2.4.2/app/code/Magento/Checkout/view/frontend/web/template/billing-address/details.html

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ * ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 21 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Since this issue got closed without info, I searched the commits a bit for a reference that mentions “AC-691” and found this one: https://github.com/magento/magento2/commit/e2e82b0036a2e42f9e5fd2750230e0f09b2e4ec4, hope it helps for people searching for a solution.

@engcom-Hotel

this is so simple programming ABC I can’t even argue here:

  1. if you request a property or method from the object and the object does not exist it will fail so currentBillingAddress().street will fail if currentBillingAddress() is “null, undefined, false , or does not have the street property”.
  2. it was working before and you were spoon fed with the exact line and before and after and pointed to a commit that changes this to be broken

If you can’t replicate this then make a condition where you can. Take dev-tools , add a breakpoint , remove the street variable from the object before you hit that line and you are there. This can happen when checkout templates are customised , network has issues as the checkout is not async, it tries to be but the asset loading is still a waterfall and quote object or any object related to it can be undefined, null, object, object with random parameters, object with full parameters, object without methods or full and proper object dependant on page loading and object init sequence .

simplest customisation trough layout file is that you reveal the payment methods on first step , just move the xml to first step and you have it

@ihor-sviziev maybe you can enlighten the team here

Hello @sdzhepa @speedupmate @ihor-sviziev

We will look into it and get back to you soon.

Thanks

@engcom-Hotel

Could you please review this issue one more time? also, i noticed that this issue was fixed in the scope https://jira.corp.magento.com/browse/AC-691. PR is created but not merged yet. I assume it means that Issue is reproducible

So, could you pls investigate the situation and bring more clarity to it?

cc: @ihor-sviziev , @speedupmate

@leonhelmus yes this is resolved in 2.4.5

@speedupmate Can you please help us from where billing address with missing street fields is added. As street field is required field. Screenshot 2021-10-21 at 6 11 21 PM