Closed basvanpoppel closed 2 years ago
Hi @basvanpoppel. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Can you proceed checkout with this js error?
Not actually blocker but turn out even you not enable settings (Set NO) but code base still check it by default
bug reported too fast :)
:white_check_mark: Confirmed by @mrtuvn
Thank you for verifying the issue. Based on the provided information internal tickets MC-43053
were created
Issue Available: @mrtuvn, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @basvanpoppel Is P3 priority correct for such case ?
Component: Recaptcha
Hi @mrtuvn I would give it P2: Checkout doesn't break (the recaptcha component isn't used, so the JS error doesn't actually hurt) it's not critical and no work-around is needed, which follows P3 description.
But this is awful for developers working on checkout: I have several custom ui components, layout processors and mixins on any checkout i work on. If there's an issue after upgrading, I will first look at my customisations, then at third party modules, then Magento.
Imagine every dev going through this process after seeing this issue, that's a lot of wasted time - and a lot of unhappy devs.
I'm working on a PR for this.
New version new bug. I would sugest to set it P1 or better P -100 !?!?!?!?! Facing the same probllem and it is ugly to have errors even if they do not break the checkout process.
My opinion Chequille
In addition to this:
Hi @mrtuvn I would give it P2: Checkout doesn't break (the recaptcha component isn't used, so the JS error doesn't actually hurt) it's not critical and no work-around is needed, which follows P3 description.
@basvanpoppel ? install a clean instance of m2 you can't checkout cause of those issues without reCaptcha configuration being enabled and valid means Magento2 does not work out of the box.
By default if extension is in system and is not configured to be used should mean no assets are included in storefront at all. Aim for this in your PR, thanks.
Fix for the impatient (Magento composer installations).
@basvanpoppel -this implements your suggested PR (https://github.com/magento/security-package/pull/302) changes :)
/patches/composer/github-issue-33741.diff
diff --git a/Block/LayoutProcessor/Checkout/Onepage.php b/Block/LayoutProcessor/Checkout/Onepage.php
index 390bf712..b2d5b777 100644
--- a/Block/LayoutProcessor/Checkout/Onepage.php
+++ b/Block/LayoutProcessor/Checkout/Onepage.php
@@ -79,7 +79,8 @@ class Onepage implements LayoutProcessorInterface
['place-order-recaptcha']['settings'] = $this->captchaUiConfigResolver->get($key);
} else {
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
- ['payment']['children']['beforeMethods']['children']['place-order-recaptcha'])) {
+ ['payment']['children']['beforeMethods']['children']['place-order-recaptcha-container']['children']
+ ['place-order-recaptcha'])) {
unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children']['beforeMethods']['children']['place-order-recaptcha-container']
['children']['place-order-recaptcha']);
@@ -89,3 +90,4 @@ class Onepage implements LayoutProcessorInterface
return $jsLayout;
}
}
+
/composer.json
{
(...)
"extra": {
(...)
"patches": {
(...)
"magento/module-re-captcha-checkout": {
"Fixed checkout reCaptcha disabling #33741": "patches/composer/github-issue-33741.diff"
}
}
}
}
@basvanpoppel @dudzio12 although good effort it does not free you from all the loaded reCaptcha mixins defined in following files, those will still wrap what they wrap enabled/disabled layout nodes included or not
vendor/magento/module-re-captcha-paypal/view/frontend/requirejs-config.js
vendor/magento/module-re-captcha-webapi-ui/view/frontend/requirejs-config.js
vendor/magento/module-re-captcha-frontend-ui/view/frontend/requirejs-config.js
vendor/magento/module-re-captcha-checkout/view/frontend/requirejs-config.js
it mostly means that even if recaptchas are not used your default behaviour is wrapped and no other module tests for those wrapped conditions and mostly assume that defaults are used
@basvanpoppel That's understandable of course, I needed patch to kickstart my project's upgrades, so it is what it is.
I'm still looking forward for you to complete the PR :)
Then I will prepare another patch to fix the issue.
@mrtuvn What is the politics on P2 bug fixes? It will be released as separate patch, next patch release -p1
or in the next minor release?
p2 label is lower priority than p1/p0. It's depend on specific case of ticket. It's not related with fix order deliver to next release. i'm not sure magento team will deliver this fixes as patch (seperate) or regular fix as normal. I saw a pull request related in the case owner disabled captcha from backend but captcha js files still request from server. But we already have PR for that here Put here for anyone interesting https://github.com/magento/magento2/pull/33200. In this specific issue imho captcha js should only available if user put both user/key pair value in backend
@mrtuvn this issue still has 'ready for dev' status, while this pr should be in the review process, I think: https://github.com/magento/security-package/pull/302
@speedupmate This PR just fixes this specific issue. Preventing other modules from adding wrappers isn't my goal here. If you know of a better way to fix this issue, please share it.
@speedupmate This PR just fixes this specific issue. Preventing other modules from adding wrappers isn't my goal here. If you know of a better way to fix this issue, please share it.
Part of this is the layoutprocessor style config you are trying to add but with a plugin to requirejs-config collection class to just exclude non-configured extension files on matching conditions (like enabled/disabled , auth failing etc).
Even better would be stopping popularising mixins as a main go to weapon in devdocs for editing/wrapping component functionality as this is really a sledgehammer that affects wider scope than usual extension tries to cover.
@speedupmate I think you haven't seen the PR, as I'm not adding config - i fixed a missing part in what's already there.
For the rest I totally agree with you.
I am waiting for this fix. When it will be fixed ? What can I do in the meantime?
The fix already mentioned above links
The fix already mentioned above links
thanks
Looks like issue is already fixed. The issue is not reproducible on the latest 2.4-develop
@chittima: could you leave some more detailed info please? Like providing commits that fixed this. Just closing an issue with so little explanation is a bit rude ...
Also: have you tested this while magento/security-package
was installed? The comments above seem to indicate that the bug is part of that package.
Hello @hostep @mrtuvn @glevhen
Let me try to shade more lite on the issue based on communication and collaboration in the internal Jira ticket.
2.4-develop
branch with security-package
installed2.4.3-p1
Based on such verification, the ticket was closed by QA with the resolution "cannot reproduce" - according to workflow. It looks like the problem was already fixed in the scope of some other PRs/commits/tasks etc.
If you still experience a similar issue on the latest version of code I would recommend opening a new issue with updated versions/steps and actual/expected results
Unbelievable !!!! we need the information what is finally be done to fix this issue. We do not want to wait till 2.4.3-p1 is out as it could take a few weeks/months till it is released.
It's actually pretty close, the release of 2.4.3-p1 😉
Thanks @sdzhepa for the extra info, however it would still be nice if somebody could figure out how it got fixed.
Just updated from 2.4.3 to 2.4.3-p1 and still experiencing this error in checkout unless reCAPTCHA is configured.
Errors being thrown due to optional configuration not being configured wastes a lot of time. As covered above when updating between versions going through a smashing any log exceptions or console errors thrown post upgrade is standard process and this error in checkout is just another distraction and another pointless issue to investigate. I don't know why errors are seen as acceptable, when the goal should be 0 errors and warnings.
Is there actually going to be a fix put in place for this?
Verified this issue on Magento 2.4-develop and 2.4.3 versions and the issue is not reproducible on 2.4-develop branch but is reproducible on 2.4.3 version:
@engcom-November Could you please check it on the 2.4.3-p1 release? (it is the lates release)
Verified the issue on 2.4.3-p1 version as well and the issue is reproducible:
@engcom-November
Do we expect a patch to be released soon?
Just a link for those looking for the actual SOLUTION https://github.com/magento/security-package/pull/302/commits/d25432de3b33946b88e93ddcfd01f5e898510a15
For anyone looking for a patch on Magento v2.4.3-p1
github-issue-33741.patch
diff --git a/vendor/magento/module-re-captcha-checkout/Block/LayoutProcessor/Checkout/Onepage.php b/vendor/magento/module-re-captcha-checkout/Block/LayoutProcessor/Checkout/Onepage.php
index 3ee2rd..8349152 111644
--- a/vendor/magento/module-re-captcha-checkout/Block/LayoutProcessor/Checkout/Onepage.php
+++ b/vendor/magento/module-re-captcha-checkout/Block/LayoutProcessor/Checkout/Onepage.php
@@ -79,7 +79,8 @@
['place-order-recaptcha']['settings'] = $this->captchaUiConfigResolver->get($key);
} else {
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
- ['payment']['children']['beforeMethods']['children']['place-order-recaptcha'])) {
+ ['payment']['children']['beforeMethods']['children']['place-order-recaptcha-container']['children']
+ ['place-order-recaptcha'])) {
unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
['payment']['children']['beforeMethods']['children']['place-order-recaptcha-container']
['children']['place-order-recaptcha']);
I would have expected this to be released as a Magento Quality Patch, or is this issue too small for that?
~I still have this issue on Magento 2.4.5~ It is solved in 2.4.5
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
ps. I think severity should be higher, because any dev working om checkout will spot this, and will be looking for a fix. (I first checked all of my modules, themes and 3rd party modules: it's time consuming.)