Skip to content

flashSession->getMessages(type, BOOLEAN remove) removed all messages #1575

Closed
@romanlex

Description

@romanlex

I'm use Flash\Session for ajax response. Code is her: http://pastebin.com/JVVenCLx
In my code I get messages by type:

$_successMessages = $this->flashSession->getMessages('success', false);
$_errorMessages = $this->flashSession->getMessages('error', false);
$_warningMessages = $this->flashSession->getMessages('warning', false);
$_noticeMessages = $this->flashSession->getMessages('notice', false);

Example:
If I send Form twice or more and in first time I get success message, in second time I get error messages...my $messages[] will contains all messages from different Ajax request :(

If I use boolean $remove flag in method:

$_successMessages = $this->flashSession->getMessages('success', true);

I don't get another messages in request :( because In first string I remove all another messages.

Example:
I send Form and get Succes and Notice messages. When I call getMessages('success', true) method - I remove all messages in Session, and I can not get Notice messages from another string

I think what removed messages should belong to the type that is caused by the method of getMessage(type)....For remove all messages must be another method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions