magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

Error in Checkout when switching from Store-Pickup to Shipping #3216

Open LyraGhost opened 4 years ago

LyraGhost commented 4 years ago

Preconditions (*)

  1. Magento 2.4.0 with sample data (clean installation)
  2. Inventory 1.2.0

Steps to reproduce (*)

  1. Create 1 or more new sources with Use as Pickup Location option enabled in it.
  2. Create new stock for default website using newly created sources
  3. Assign products to newly created sources and add inventory in it so it can be available for pickup.
  4. Enable In store Delivery shipping method from Store Config/Sales/Delivery Methods (and at least one other method)
  5. Login with account with at least one (1) default shipping address
  6. Add product to cart
  7. View cart, select In-Store Pickup in shipping estimate, and proceed to checkout
  8. Switch from Pick In Store to Shipping

Expected result (*)

  1. Default shipping address should be selected
  2. no errors in console
  3. able to proceed to payment step

Actual result (*)

  1. Error in console
    rules.js:69 Uncaught TypeError: Cannot read property 'length' of null
    at Object.handler (rules.js:69)
    at validate (validator.js:44)
    at validator.js:84
    at Function._.every._.all (underscore.js:237)
    at validator (validator.js:82)
    at UiClass.validate (abstract.js:406)
    at UiClass.onUpdate (abstract.js:431)
    at Function.notifySubscribers (knockout.js:1320)
    at Function.valueHasMutated (knockout.js:1538)
    at UiClass.observable [as value] (knockout.js:1504)
    ...
  2. unable to proceed to payment step

Notes

My initial guess is the error has to do with new address form, as the stack trace mentions validate and ui form/element/abstract. Edit: It seems to be an issue with setting the shipping address when switching methods, as even trying to enter a new address:

Overall the implementation here is very buggy and needs significant work to get it working.

Also, if you return to the shopping cart (regardless of method) and proceed to checkout again, only the sidebar loads and the same error is presented in the console. You need to log out and log back in to be able to load the checkout fully again.

m2-assistant[bot] commented 4 years ago

Hi @LyraGhost. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


i370w commented 3 years ago

Hello, is there a solution for this error or workaround? I have the same problem, issue persists on login.

Uncaught TypeError: Cannot read property 'length' of null at Object.handler (rules.js:69) at validate (validator.js:44) at validator.js:84 at Function..every..all (underscore.js:237) at validator (validator.js:82) at UiClass.validate (abstract.js:406) at UiClass._super (wrapper.js:106) at UiClass.validate (setAdditionalParams.js:20) at UiClass.validate (wrapper.js:109) at UiClass.onUpdate (abstract.js:431)