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

!!!FEATURE: Configurable FlashMessage containers #1061

Open
wants to merge 9 commits into
base: master
from

Conversation

3 participants
@bwaidelich
Copy link
Member

commented Aug 17, 2017

Introduces a new setting Neos.Flow.mvc.flashMessages.containers
that allows to configure separate FlashMessage containers.

It also changes the default behavior to persist FlashMessages in a
session Cookie rather than in a server-side session.

This is a breaking change because it changes the API slightly by
removing the @api annotation from the FlashMessageContainer.
This is required because that object is no longer stored in the
session by default.
Instead of interacting with the FlashMessageContainer directly,
the addFlashMessage() method must be used now.

The FlashMessageContainer can still be fetched from the
ControllerContext but this will internally now use the
FlashMessageService to restore the container from the configured
storage implementation.

Background:

This patch changes the default behavior to store FlashMessages in
a (HTTP) session cookie. This should not have any effect to the
PHP code and FlashMessages can still be obtained with the
<f:flashMessages /> Fluid ViewHelper.
However, the FlashMessages can now also be read from JavaScript
allowing the redirected action to be cached!

Furthermore it's now possible to use different cookies for different
parts of the website so that FlashMessages don't interact.
This is useful for example for FlashMessages in the Neos Backend
and/or within plugins.

!!!FEATURE: Configurable FlashMessage containers
Introduces a new setting `Neos.Flow.mvc.flashMessages.containers`
that allows to configure separate FlashMessage containers.

It also changes the default behavior to persist FlashMessages in a
session Cookie rather than in a server-side session.

This is a breaking change because it changes the API slightly by
removing the `@api` annotation from the `FlashMessageContainer`.
This is required because that object is no longer stored in the
session by default.
Instead the `addFlashMessage()` method must be used.

The `FlashMessageContainer` can still be fetched from the
`ControllerContext` but this will internally now use the
`FlashMessageService` to restore the container from the configured
storage implementation.

Background:

This patch changes the default behavior to store FlashMessages in
a (HTTP) session cookie. This should not have any effect to the
PHP code and FlashMessages can still be obtained with the
`<f:flashMessages />` Fluid ViewHelper.
However, the FlashMessages can now also be read from JavaScript
allowing the redirected action to be cached!

Furthermore it's now possible to use different cookies for different
parts of the website so that FlashMessages don't interact.
This is useful for example for FlashMessages in the Neos Backend
and/or within plugins.
@mention-bot

This comment has been minimized.

Copy link

commented Aug 17, 2017

@bwaidelich, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kdambekalns, @kitsunet and @daniellienert to be potential reviewers.

@bwaidelich

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2017

@albe

This comment has been minimized.

Copy link
Member

commented Oct 19, 2017

Looking at the upcoming LTS and that we don't have any real major features for it (yet), can we somehow add this in a way that makes it less breaking and eligible for the LTS? Would be a nice thing to have in there

@albe albe added this to Needs more work in Neos 3.3 & Flow 4.3 Release Board Nov 7, 2017

@albe

This comment has been minimized.

Copy link
Member

commented Apr 20, 2019

@bwaidelich would still be cool to get this in now with 6.0. Is there anything left to do technically other than resolving conflicts and writing documentation for the feature?

@bwaidelich

This comment has been minimized.

Copy link
Member Author

commented Apr 24, 2019

I agree. It would be cool to have this for 6.0 but currently it's not on top of my personal priority list

Is there anything left to do technically other than resolving conflicts and writing documentation for the feature

No I don't think so

@albe

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

Is there anything left to do technically other than resolving conflicts and writing documentation for the feature

No I don't think so

Cool, so I think that's something that anyone can do then (myself included) :) Thanks for the quick reply!

@albe albe added I: Needs Documentation and removed I: WIP labels Apr 25, 2019

albe added some commits Apr 25, 2019

@albe

This comment has been minimized.

Copy link
Member

commented May 21, 2019

Green 🎉 Only thing left is documentation now.

@albe albe added this to In progress in Neos 5.0 & Flow 6.0 Release Board via automation Jul 6, 2019

@kdambekalns kdambekalns moved this from In progress to Needs review in Neos 5.0 & Flow 6.0 Release Board Jul 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.