Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento2 message manager error #3503

Closed
vipin-eglobeits opened this issue Feb 22, 2016 · 23 comments
Closed

Magento2 message manager error #3503

vipin-eglobeits opened this issue Feb 22, 2016 · 23 comments
Assignees
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@vipin-eglobeits
Copy link

In Magento2 login page, if we try to login with wrong credentials, the error message('Invalid login or password.') is not showing on the same page and they will show only on any other page with some other message.
issue

Anybody please help me to solve this issue.
I'm using latest Magento 2.0.2 version.

@vipin-eglobeits vipin-eglobeits changed the title Magento2 mssage manager error Magento2 message manager error Feb 22, 2016
@sengaigibon
Copy link

I have the same problem plus this:
#3572

@FranRoy
Copy link

FranRoy commented Mar 18, 2016

I have exactly the same problem. Is there any news?

@sengaigibon
Copy link

@vipin-eglobeits and @FranRoy , can you share with us some details about your installation environment? such as operating system, running a virtual machine or containers? any special software running on your Magento instance? Thanks!

@FranRoy
Copy link

FranRoy commented Mar 28, 2016

Sure @sengaigibon, It is a fresh install on a EC2 + MySQL RDS amazon environment with nginx and php7. It is runing the amazon linux S.O. The only peculiarity is that I did a migration (products,categories + customers) using the migration tool. Also It is important to mention that yesterday I noticed that If I activate the caches, the problem is no longer happening... So the issue happens when caches as deactivated. Thanks!

@slavvka
Copy link
Member

slavvka commented Apr 14, 2016

Hi all, this is the known issue and we have the internal ticket MAGETWO-46014 to have this fixed

@slavvka slavvka added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Apr 14, 2016
@lennartlott
Copy link

Is this issue already fixed or in process?

@slavvka
Copy link
Member

slavvka commented May 18, 2016

Hi @vipin-eglobeits, the fixe has been delivered to mainline. See commits 541ec80, 55a6e51, b4d3739, eec31f6, af2a832, d97ebe5, 3120b1e and 66e6ad6. Thank you for your contribution to Magento 2!

@slavvka slavvka closed this as completed May 18, 2016
@chris-brabender
Copy link

@slavvka not sure if this has been brought up previously, but we applied these patches to a 2.0.7 installation and the Admin notifications (saved product etc) are being shown on the frontend only.

No save message after save product in admin

screen shot 2016-05-25 at 9 49 43 pm

Refresh frontend

screen shot 2016-05-25 at 9 50 00 pm

@andidhouse
Copy link

@slavvka Is this really fixed in 2.1 to 2.1.2 - i cannot see this fixed at all and it is a bug reported several times here in several tickets... in my opinion it is time to fix it now!

@baltechies
Copy link

I have same issue in magento 2.1.5.

@abhilashv1985
Copy link

I have the issue in 2.1.5 as well ! Message that comes won't go. I can see that the "mage-messages" cookie is being cleared in messages.js but still the issue persists. Please find a fix for this ASAP.

@niranjanleanswift
Copy link

niranjanleanswift commented May 19, 2017

There is a workaround you can do for the messages go away since the messages are stored in the session and sometimes the messages are not cleared from the session this cause the cookies retrieve the values from the session. Hence we need to clear the session values which stores the messages.

I have created the plugin to delete the session from the message manager for this operation, we need two files with module enabled and it is running.

1.di.xml

<type name="Magento\Framework\Message\Manager">
        <plugin name="remove-messages-fromsession" type="Vendor\ModuleName\Plugin\DeleteMessageFromSession"/>
    </type>

2.Plugin file - we need to use the around type to do this


 public function aroundGetMessages(
        \Magento\Framework\Message\Manager $subject,
        \Closure $proceed,
        $clear = false,
        $group = null
    )
    {
        $messages = $proceed($clear, $group);
        //if the clear option is entered
        if ($clear) {
            //the session clear is entered
            $this->session->getData($group, true);
        }
        return $messages;
    }

`
Since the session member is protected we have inherit this class from
\Magento\Framework\Message\Manager

Hope this will help you and it is working for me

@dangnguyenak
Copy link

dangnguyenak commented Jan 4, 2018

@niranjanleanswift can you share full code of that plugin, it doesn't work for me
my magento version is 2.2.1
upload_12_27_2017_at_5_47_41_pm

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Jan 4, 2018
@DanielRuf DanielRuf reopened this Aug 24, 2018
@DanielRuf
Copy link
Contributor

Still not fixed in 2.2+. Can someone create a forward port?

@DanielRuf
Copy link
Contributor

DanielRuf commented Aug 24, 2018

https://github.com/magento/magento2/search?q=MAGETWO-46014%3A+delayed+error+messages&type=Commits

It would have been better if these 8 commits were squashed into one.

git cherry-pick \
541ec806cae729df118b7844f5d105cbf1a6cec6 \
55a6e51296afd2c52cfe7f813a4871ae408f1afc \
b4d373919489ccb48af10c5ac287ef39e3af384e \
eec31f653e3783d0ba86602c8396fd6e2d159546 \
af2a8325930ae22e2b7ae3f6513c0068217eacd1 \
d97ebe56200b73e71d97ca527c99108817586a54 \
3120b1e89f48ff630e796c6885aecc3e48c070c8 \
66e6ad66c028e99019c110631df4c9015af4a2ca

But this produces many conflicts due to the different code structures.

magento-engcom-team pushed a commit that referenced this issue Dec 4, 2018
@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 27, 2018

@magento-engcom-team give me 2.2.2 instance

@magento-engcom-team
Copy link
Contributor

Hi @sdzhepa. Thank you for your request. I'm working on Magento 2.2.2 instance for you

@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 27, 2018

@magento-engcom-team give me 2.2.3 instance

@magento-engcom-team
Copy link
Contributor

Hi @sdzhepa. Thank you for your request. I'm working on Magento 2.2.3 instance for you

@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 27, 2018

Hello @vipin-eglobeits , @DanielRuf, @dangnguyenak

We have verified this issue on 2.2.2, 2.2.3, 2.3 by described steps/instructions fron this ticket.

  • Customer login with incorrect password(several attampts)
  • Create Products from Admin
  • With enabled and disabled caches.

And seem this issue has been fixed
This ticket can be closed.
Please, feel free to reopen or create a new one with details and steps if issue still exists or was not fully fixed

Thank you for feedback and collaboration

@sdzhepa sdzhepa closed this as completed Dec 27, 2018
@sdzhepa sdzhepa added Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Dec 27, 2018
@DanielRuf
Copy link
Contributor

@sdzhepa did the bot not create the instances or were the comments deleted?

@feeh27
Copy link

feeh27 commented Nov 18, 2020

I'm using version 2.4.1 and we still have this problem, I created a plugin in my base module as indicated below and that solved the problem.

Thanks @niranjanleanswift

There is a workaround you can do for the messages go away since the messages are stored in the session and sometimes the messages are not cleared from the session this cause the cookies retrieve the values from the session. Hence we need to clear the session values which stores the messages.

I have created the plugin to delete the session from the message manager for this operation, we need two files with module enabled and it is running.

1.di.xml

<type name="Magento\Framework\Message\Manager">
        <plugin name="remove-messages-fromsession" type="Vendor\ModuleName\Plugin\DeleteMessageFromSession"/>
    </type>

2.Plugin file - we need to use the around type to do this


 public function aroundGetMessages(
        \Magento\Framework\Message\Manager $subject,
        \Closure $proceed,
        $clear = false,
        $group = null
    )
    {
        $messages = $proceed($clear, $group);
        //if the clear option is entered
        if ($clear) {
            //the session clear is entered
            $this->session->getData($group, true);
        }
        return $messages;
    }

`
Since the session member is protected we have inherit this class from
\Magento\Framework\Message\Manager

Hope this will help you and it is working for me

@starmate
Copy link

starmate commented Oct 5, 2021

I'm using version 2.4.1 and we still have this problem, I created a plugin in my base module as indicated below and that solved the problem.

Thanks @niranjanleanswift

There is a workaround you can do for the messages go away since the messages are stored in the session and sometimes the messages are not cleared from the session this cause the cookies retrieve the values from the session. Hence we need to clear the session values which stores the messages.
I have created the plugin to delete the session from the message manager for this operation, we need two files with module enabled and it is running.
1.di.xml

<type name="Magento\Framework\Message\Manager">
        <plugin name="remove-messages-fromsession" type="Vendor\ModuleName\Plugin\DeleteMessageFromSession"/>
    </type>

2.Plugin file - we need to use the around type to do this


 public function aroundGetMessages(
        \Magento\Framework\Message\Manager $subject,
        \Closure $proceed,
        $clear = false,
        $group = null
    )
    {
        $messages = $proceed($clear, $group);
        //if the clear option is entered
        if ($clear) {
            //the session clear is entered
            $this->session->getData($group, true);
        }
        return $messages;
    }

`
Since the session member is protected we have inherit this class from
\Magento\Framework\Message\Manager
Hope this will help you and it is working for me

Hello,

I am also using Magento 2.4.1 and using this code kind of helped. Meaning, the messages are now properly showing but if you update your customer address for example and go on catalog page, the success message for changing the address is showing on the product page as well as on cart page if you add the product in shopping cart for example.

@feeh27 : do you also have this type of issue? Have you managed to fix it?

Thanks,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests