webmcp

changeset 455:e2389cc82214

Improved include_tempstore argument to request.redirect{...}
author jbe
date Thu Jul 21 19:23:23 2016 +0200 (2016-07-21)
parents 4e03ecb28665
children 59a6f4851764
files framework/env/request/handler.lua framework/env/request/redirect.lua
line diff
     1.1 --- a/framework/env/request/handler.lua	Thu Jul 21 19:19:42 2016 +0200
     1.2 +++ b/framework/env/request/handler.lua	Thu Jul 21 19:23:23 2016 +0200
     1.3 @@ -234,8 +234,13 @@
     1.4        slot.put("</p>")
     1.5      end)
     1.6    elseif redirect_data then
     1.7 -    redirect_data = table.new(redirect_data)
     1.8 -    if not redirect_data.external or redirect_data.include_tempstore then
     1.9 +    if
    1.10 +      redirect_data.include_tempstore == true or (
    1.11 +        redirect_data.include_tempstore ~= false and
    1.12 +        not redirect_data.external
    1.13 +      )
    1.14 +    then
    1.15 +      redirect_data = table.new(redirect_data)
    1.16        redirect_data.params = table.new(redirect_data.params)
    1.17        local slot_dump = slot.dump_all()
    1.18        if slot_dump ~= "" then
     2.1 --- a/framework/env/request/redirect.lua	Thu Jul 21 19:19:42 2016 +0200
     2.2 +++ b/framework/env/request/redirect.lua	Thu Jul 21 19:23:23 2016 +0200
     2.3 @@ -9,7 +9,7 @@
     2.4    id       = id,        -- optional id to be passed to the view or action to select a particular data record
     2.5    params   = params,    -- optional parameters to be passed to the view or action
     2.6    anchor   = anchor,    -- anchor in URL
     2.7 -  include_tempstore = include_tempstore  -- set to true to include slot data via _tempstore param when using external URL
     2.8 +  include_tempstore = include_tempstore  -- set to true to include slot data via _tempstore param (defaults to true unless external is set)
     2.9  }
    2.10  
    2.11  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.

Impressum / About Us