5

i´ve just installed a fresh Magento2 on my webspace to prepare the migration of my Magento 1.9.

I installed my theme (Infortis) and created my products and did the first test-salse. Everything fine...

But if I try to logout as a Customer this error appears:

There has been an error processing your request
Notice: Undefined index: form_key in vendor/magento/module-customer/Model/Plugin/CustomerFlushFormKey.php on line 48

Since there isn't even a valid google result on this file, I hope that you can tell me what to do.

  • Answer from user (=OP?): "This is really strange... I wanted to test the issue again this morning before disabling all extensions/themes one by one. The Error is gone. Do you think it is possible that over night just a wrong session cache got purged or something like that? --solved :) --" – 7ochem Jun 13 '18 at 8:26
3

What I did to fix the issue is that I went to this file: /vendor/magento/module-customer/Model/Plugin/CustomerFlushFormKey.php

and, on line 48 with the ff. codes:

if ($beforeParams['form_key'] == $currentFormKey) {....}

I added a checker for the $beforeParams['form_key']:

if (!empty($beforeParams['form_key']) && $beforeParams['form_key'] == $currentFormKey) {...}

This is just a band-aid fix for me to proceed on logging out. Hope this helps you!

  • Hi everyone just to update this comment! We addressed this issue to Magento 2 Support and they were able to provide us with a patch for this! – Eubie Aluad Jul 20 '18 at 2:13
0

Since you use a theme, the issue can be:
- the theme has an issue and you may want to put a request to infortis support
- the issue may also be due to the server setup but quite unlikely. To check out this possibility, you may search for errors: server error log
--> it is worthwhile trying to isolate what is the origin of the issue: I would disable the theme to get started and try again.

0

This is really strange...

I wanted to test the issue again this morning before disabling all extensions/themes one by one.

The Error is gone. Do you think it is possible that over night just a wrong session cache got purged or something like that?

--solved :) --

0

There is an error in magento 2 It's resolved in this PR: https://github.com/magento/magento2/pull/16386/files/90e37b59cce7e07a4aee3a5bbc9a00b10aaa58a6

If you want fix this bug in your project you can override the plugin vendor/magento/module-customer/Model/Plugin/CustomerFlushFormKey.php and change the condition in line 48 to

if (isset($beforeParams['form_key']) && $beforeParams['form_key'] === $currentFormKey) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.