-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[2.0.0]+ \Flash\Session getMessages() removes all messages #10734
Comments
Does not remove only the type error, you must also pass on success false, and retrieve only error again, |
@tidytrax That will work. I have to admit I came across the same issue and thought the expected behavior would filter flash messages based on type, but after testing for a few seconds, realized it did not. This really isn't an issue, it's currently the expected behavior, but it's a common pitfall. Perhaps at a minimum the PHPDOC blocks / documentation could be updated for these methods to explain this distinction a little bit better. |
I agree my Messages implementation only erase the Key (error,warning,info, success) Hope that i help |
This was the case in earlier versions of Phalcon (up to and including 1.3.4), but apparently it changed with the release of Phalcon 2.0.0. We only found out about this after upgrading and our code stopped working. This change is not listed in the changelog hence I assumed it was a bug. Apparently it's not, so I will close the issue. |
Using the getMessages() without the $remove parameter or with it set to true removes all flash messages, regardless of the $type parameter passed with it. To me it looks like a return of Issue 1575, more or less.
Here's some example code:
This returns:
instead of the expected:
The text was updated successfully, but these errors were encountered: