Sradesign Posted November 16, 2015 Share Posted November 16, 2015 Hi I have a problem after updating from 2.6 to 2.7, all the flash messages that I have in frontend stays and I can not remove them the only way to get read of them is to remove them whole session from browser. Best Regards, Ali.M Link to comment Share on other sites More sharing options...
kongondo Posted November 16, 2015 Share Posted November 16, 2015 PW notices in the frontend? You mean the backend/admin? Link to comment Share on other sites More sharing options...
Sradesign Posted November 16, 2015 Author Share Posted November 16, 2015 no I load my messages in frontend pages after login cause I have separate admin pages for myself and do some action in it like updating user details and etc before update everything with messages was great but now everything stay in browsers cache by the way my project is on wamp localhost. Link to comment Share on other sites More sharing options...
Sradesign Posted November 16, 2015 Author Share Posted November 16, 2015 See the attachment please this is my own admin which is separate from processwire admin is basically a page with my custom template and restrictions. 2 Link to comment Share on other sites More sharing options...
Sradesign Posted November 16, 2015 Author Share Posted November 16, 2015 <?php if($notices){ ?> <?php foreach($notices as $notice){ if($notice instanceof NoticeMessage) { $class = 'success '; $text = $notice->text; $icon = 'check'; } if($notice instanceof NoticeError || $notice->flags & Notice::warning) { if($notice->flags & Notice::warning) { $class .= 'alert-warning'; $icon = 'warning'; } else { $class .= 'alert-danger'; $icon = 'exclamation-triangle'; } } if($notice->flags & Notice::debug) { $class .= 'danger'; $icon = 'gear'; } if(!$icon) $icon = 'fa fa-check'; ?> <div class="alert alert-<?php echo $class; ?> alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <i class="fa fa-<?php echo $icon; ?>"></i> <?php echo $notice->text;?> </div> <?php } ?> <?php } ?> This is my code for showing the messages and below is the code that I have in order to create them. foreach($files4 as $filename) { $user->doc4->removeAll(); $user->doc4->add($upload_path . $filename); $user->message("Added file 4 : $filename"); unlink($upload_path . $filename); } $user->save(); $user->of(true); $session->message(__('Personal Information updated successfully')); $this->session->redirect($this->page->url); Link to comment Share on other sites More sharing options...
kongondo Posted November 16, 2015 Share Posted November 16, 2015 Ah, OK, I see. Have no idea really why that is happening. Did your config settings change? (the module system notification ones)? Other than that, cool admin! 1 Link to comment Share on other sites More sharing options...
Sradesign Posted November 16, 2015 Author Share Posted November 16, 2015 Yeah I'm working on this admin when I finish it I may send it to rayan to put it up for anyone who want to use it. the module system notification ones I'll check it but I didn't change anything Link to comment Share on other sites More sharing options...
Sradesign Posted November 16, 2015 Author Share Posted November 16, 2015 Nope no change we have some line added in the new config file but nothing regarding the sessions and messages changed. Link to comment Share on other sites More sharing options...
kongondo Posted November 16, 2015 Share Posted November 16, 2015 Any JS errors in the console? Link to comment Share on other sites More sharing options...
WillyC Posted November 16, 2015 Share Posted November 16, 2015 u cane do $session->removeNotices(); aftr u dipslay.notices 4 Link to comment Share on other sites More sharing options...
Craig Posted November 16, 2015 Share Posted November 16, 2015 WillyC is right. I noticed this too, and updated a relevant issue at GitHub. 3 Link to comment Share on other sites More sharing options...
Sradesign Posted November 17, 2015 Author Share Posted November 17, 2015 Any JS errors in the console? No Js error at all u cane do $session->removeNotices(); aftr u dipslay.notices It doesn't work I tried that too. WillyC is right. I noticed this too, and updated a relevant issue at GitHub. Thanks I checked it and doesn't seems to work Link to comment Share on other sites More sharing options...
Sradesign Posted November 17, 2015 Author Share Posted November 17, 2015 Ok I got a small mistake and put the $session->removeNotices(); inside the submit condition I put it out and it seems like to fix the issue for now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now