- Issue created by @muaz91
- 🇲🇾Malaysia muaz91 MY
I've also tried another kernal event "Start dispatching request" with the same conditions and actions, the url redirect is working, but the notification still does not shown
- 🇩🇪Germany jurgenhaas Gottmadingen
Is that for authenticated users the same as for anonymous users?
- 🇲🇾Malaysia muaz91 MY
@jurgenhaas, I think both. I've test for anonymous still not have the notification message
- 🇩🇪Germany jurgenhaas Gottmadingen
That's what I expected. Messages from Drupal get stored in the session to be displayed across page requests. Since anonymous users don't have a session, Drupal can't keep messages for them to be displayed on the next page request. Without a redirect, there is only 1 page request, and that's why it works there.
To validate that assumption, you may want to test this with authenticated users, there it should work.
- 🇲🇾Malaysia muaz91 MY
I am sorry for not clarifying enough for my comment. I have tested out on both logged in and out, and both does not show any notification when redirecting to another page.
For my use case is actually for authenticated users, and as stated, the redirecting is okay, but the message does not shown as expected. I've attach screenshot for the ECA model setup below
- 🇩🇪Germany jurgenhaas Gottmadingen
I can't reproduce this problem for authenticated users. I've loaded the model you've uploaded above, and it works just fine for authenticated users, but not for anonymous users.
This is somehow strange, as I have added a couple of more messages to the model like this:
For authenticated users, all 4 messages get displayed.
For anonymous users, the bottom 2 (those without condition) get displayed, the top 2 don't. This must be something that Drupal core must be doing in
\Drupal\Core\Action\Plugin\Action\GotoAction::execute
where it flushes the messages for anonymous users that got collected up to that point, but not any others.To find out in details, I guess this requires an intensive debugging session. @muaz91 any chance you could go through that with xdebug?
- 🇲🇾Malaysia muaz91 MY
Hi,
It seems that the problem is occured when disabling the module bigpipe. I'm not sure why I've disabled it before. When enable the notification is shown as normal.
- Status changed to Fixed
over 1 year ago 3:23am 30 May 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Good finding. Shouldn't we try and make it work in all cases?
- 🇲🇾Malaysia muaz91 MY
Good finding. Shouldn't we try and make it work in all cases?
It would be great! I can help test @jurgenhaas
- Status changed to Active
over 1 year ago 3:02am 6 June 2023 - Assigned to jurgenhaas
- 🇩🇪Germany jurgenhaas Gottmadingen
This is most likely related to 💬 Redirects and Drupal cache Fixed
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 1:29pm 1 August 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
@muaz91 seems like we can get this to work without even providing new ECA functionality. Please have a look at this comment and let us know if that works for you too. The important difference is that the event
Controller found
, which is used in your model, isn't the right one. We need to switch that toResponse created
, then it works just nicely. - 🇲🇾Malaysia muaz91 MY
It works! I've tested out with annonymous, and also with disabling bigpipe. both works.
Thank you @jurgenhaas
- Status changed to Fixed
over 1 year ago 6:52am 4 August 2023 - 🇩🇪Germany jurgenhaas Gottmadingen
Thanks for your feedback, glad we've sorted this out. Will add something about this to the ECA Guide.
Automatically closed - issue fixed for 2 weeks with no activity.