We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Flashdata alert messages not being displayed on View Entry page.

Development and Programming

bryantAXS's avatar
bryantAXS
50 posts
13 years ago
bryantAXS's avatar bryantAXS

I have some code inside a method hooked to entry_submission_redirect which calls $this->EE->session->set_flashdata(), and passes in an array like so:

$messages = array();
$messages["message_success"] = "Success message goes here";
$this->EE->session->set_flashdata($messages);

later on in the entry_submission_redirect, I am either redirecting the user back to the Publish Form (if there is an error), or not redirecting them at all and passing back the $orig_loc parameter, which takes them to the “View Entry” page (default behavior).

My issue is, when I let the default behavior happen, and I get redirected to the View Entry page, my Flash Messages do not show up. When I redirect them to the Publish page they do, correctly. I have also been having problems setting cookies from this method, using $this->EE->functions->set_cookie(), which doesn’t add the cookie.

Has anyone run into this issue before? It seems like sessions and cookies are unable to be set from this method…?

Thanks in advance!

       
Dan Decker's avatar
Dan Decker
7,338 posts
13 years ago
Dan Decker's avatar Dan Decker

Hi Bryant,

What version of ExpressionEngine are you developing against?

If you think you’ve found a bug, be sure to file it in the Bug Tracker.

For now though, I have to move this over to Development and Programming.

Thanks!

       
bryantAXS's avatar
bryantAXS
50 posts
13 years ago
bryantAXS's avatar bryantAXS

Currently using 2.5.2 – I’ll look at it again and post it to the Bug Tracker if necessary.

Thanks

       
the3mus1can's avatar
the3mus1can
426 posts
13 years ago
the3mus1can's avatar the3mus1can

I don’t think this is a bug, but is probably not the desired behavior. If you look at the end of the _save method in the Content_publish controller class you will see that it sets a ‘message_success’ flash message. This is probably overwriting the message you set earlier in your extension. If you are redirecting the user from inside your extension then that explains why it works in that scenario as it never reaches the end of the _save method.

       
bryantAXS's avatar
bryantAXS
50 posts
13 years ago
bryantAXS's avatar bryantAXS

I actually had noticed that in the _save method and commented out that last minute success message. The flash messages were still not displayed. Good thought though.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.