[Issue] Moving array access for CAPTCHA _.isEmpty check #31641
Labels
Component: Captcha
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Severity: S2
Major restrictions or short-term circumventions are required until a fix is available.
Projects
This issue is automatically created based on existing pull request: #31636: Moving array access for CAPTCHA _.isEmpty check
When upgrading to 2.3.6 from 2.3.5-p2, a new CAPTCHA zone "payment_processing_request" is added.
If a customer has an existing session (from 2.3.5-p2 or prior), and tries to access checkout with their existing session data, checkout will fail to load because the check to see if
captchaData[formId]
exists is not a valid function call._.isEmpty()
only returns a boolean value, so it cannot be enumerated like an array. Array access syntax has been moved in to the check, rather than outside it.Description (*)
This change allows a
_.isEmpty()
check in thedefaultCaptcha.js
file to complete successfully, resolving issues with the checkout failing to load or infinitely loading after upgrading.Related Pull Requests
N/A
Fixed Issues (if relevant)
N/A - no reported issue for this yet?
Manual testing scenarios (*)
captcha
key of themage-cache-storage
local storage key. There should not be an entry forpayment_processing_request
/checkout
route with the same session as before/checkout
againQuestions or comments
I'm not sure if an issue is needed for this PR, but happy to make one if one is needed. This will also need to be backported to 2.3.6.
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: