Error message: Warning: Invalid argument supplied for foreach() in /core/lib/Drupal/Core/Form/FormState.php on line 1112
Steps to reproduce:
1. Log in with an existing user (works as per usual using the 8.x-1.0-rc2 build)
2. Added some items and checkout
3. Enter a new 3D secure payment card and attempt to pay with it
4. The above exception is thrown. Full log attached.
Commerce: 2.14
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot at Sep 09 17-20-08.png | 629.11 KB | carsteng |
| checkout_log_20190907.txt | 235.6 KB | vanlindholm |
Issue fork commerce_stripe-3079832
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mglamanCan you provide the testing card number you used? We have tests covering this and I want to see how we can improve them. Do you have Commerce 2.14?
Unfortunately, the log shows the problem is in an empty #parents array. That makes it really hard to troubleshoot as we don't know what is causing there to be an empty array.
Have you been able to reproduce locally or help provide debugging?
Comment #3
carsteng commentedI get a similar bug:
The same steps to reproduce but I have used a real credit card in test mode.
The API answers with: Your card was declined. Your request was in test mode, but used a non test (live) card. For a list of valid test cards, visit: https://stripe.com/docs/testing.
Therefore in doCreatePaymentMethod() the Exception is raised.
Apperently there is an issue with the address form element. Check the image.
Comment #4
vanlindholm commentedHi Matt,
I used commerce 2.14 and the 4000000000003220 testing card.
Thanks,
Thomas
Comment #7
primsi commentedI opened a MR. This fixes the issue for us, but I am not sure if that's the optimal approach.
Comment #8
jonathanshawThis is a duplicate of #3177168: line 1112 of /app/web/core/lib/Drupal/Core/Form/FormState.php when postal code validation fails (although the patch here is perhaps slightly better).