Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

snippet Msgs.ShowAll should not be a session var #805

Merged
merged 1 commit into from

3 participants

David Pollak github-importer Diego Medina
David Pollak
Owner

More of the global nastiness around Msgs. I think I need to totally re-write the messages mechanism... perhaps to use wiring.

David Pollak
Owner

There are also issues with S.error/S.notice/S.warning in the context of a CometActor

David Pollak
Owner
David Pollak dpp was assigned
Diego Medina fmpwizard was assigned
Diego Medina fmpwizard * Fixes 805 - snippet Msgs.ShowAll should not be a session var
By being a SessionVar, it meant that if you had two pages, one with showAll=true and the second
page with showAll=false (or omitted), messages that correspond to an ID would show or not
depending on which page was loaded last (setting the SessionVar to true or false).

Now we use a RequestVar and all is well.
0a98248
David Pollak dpp merged commit cde876c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 20, 2012
  1. Diego Medina

    * Fixes 805 - snippet Msgs.ShowAll should not be a session var

    fmpwizard authored
    By being a SessionVar, it meant that if you had two pages, one with showAll=true and the second
    page with showAll=false (or omitted), messages that correspond to an ID would show or not
    depending on which page was loaded last (setting the SessionVar to true or false).
    
    Now we use a RequestVar and all is well.
This page is out of date. Refresh to see the latest.
9 web/webkit/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala
View
@@ -18,12 +18,15 @@ package net.liftweb
package builtin
package snippet
-import net.liftweb.http.{DispatchSnippet,LiftRules,NoticeType,S,SessionVar}
+import http._
import scala.xml._
import net.liftweb.util.Helpers._
import net.liftweb.http.js._
import JsCmds._
import net.liftweb.common.{Box, Full, Empty}
+import common.Full
+import xml.Text
+import snippet.AjaxMessageMeta
/**
@@ -219,8 +222,8 @@ object MsgsErrorMeta extends SessionVar[Box[AjaxMessageMeta]](Empty) {
* This SessionVar records whether to show id-based messages in
* addition to non-id messages.
*/
-object ShowAll extends SessionVar[Boolean](false) {
- override private[liftweb] def magicSessionVar_? = true
+object ShowAll extends RequestVar[Boolean](false) {
+ //override private[liftweb] def magicSessionVar_? = true
}
/**
Something went wrong with that request. Please try again.