# HG changeset patch # User jbe # Date 1469121803 -7200 # Node ID e2389cc82214e8cf1ea354a6579f4fbc963e0c87 # Parent 4e03ecb28665b0b76bcdf206c34a9f29e51f68c2 Improved include_tempstore argument to request.redirect{...} diff -r 4e03ecb28665 -r e2389cc82214 framework/env/request/handler.lua --- a/framework/env/request/handler.lua Thu Jul 21 19:19:42 2016 +0200 +++ b/framework/env/request/handler.lua Thu Jul 21 19:23:23 2016 +0200 @@ -234,8 +234,13 @@ slot.put("

") end) elseif redirect_data then - redirect_data = table.new(redirect_data) - if not redirect_data.external or redirect_data.include_tempstore then + if + redirect_data.include_tempstore == true or ( + redirect_data.include_tempstore ~= false and + not redirect_data.external + ) + then + redirect_data = table.new(redirect_data) redirect_data.params = table.new(redirect_data.params) local slot_dump = slot.dump_all() if slot_dump ~= "" then diff -r 4e03ecb28665 -r e2389cc82214 framework/env/request/redirect.lua --- a/framework/env/request/redirect.lua Thu Jul 21 19:19:42 2016 +0200 +++ b/framework/env/request/redirect.lua Thu Jul 21 19:23:23 2016 +0200 @@ -9,7 +9,7 @@ id = id, -- optional id to be passed to the view or action to select a particular data record params = params, -- optional parameters to be passed to the view or action anchor = anchor, -- anchor in URL - include_tempstore = include_tempstore -- set to true to include slot data via _tempstore param when using external URL + include_tempstore = include_tempstore -- set to true to include slot data via _tempstore param (defaults to true unless external is set) } Calling this function causes the WebMCP to do a 303 HTTP redirect after the current view or action and all filters have finished execution. If routing mode "redirect" has been chosen, then this function is called automatically after an action and all its filters have finished execution. Calling request.redirect{...} (or request.forward{...}) explicitly inside an action will cause routing information from the browser to be ignored. To preserve GET/POST parameters of an action, use request.forward{...} instead. Currently no redirects to external (absolute) URLs are possible, there will be an implementation in future though.