[jifty-devel] state variable craziness

Chia-liang Kao clkao at bestpractical.com
Sat Sep 8 09:49:10 EDT 2007


Hi,

I've just committed a test app for the SinglePage plugin, which exploits
some bugs in variable and region variable handling.  the test app
consists of a page with a select dropdown, submit the value to a region
that it replaces with, which contains a createuser action and a redirect
action that comes back to the first page.  here's the transcibed dialog:

---------- client sends onclick replace with explicit args
{"path":"/__jifty/webservices/xml","actions":{},"fragments":{"__page":{"name":"__page","path":"/page2","args":{"":"Next","foo":"4"},"parent":null}},"variables":{"region-__page":"/page2","region-__page.":"Next","region-__page.foo":"4"},"continuation":{}}
---------- server returns an action form with serialized variables
<form method="post" action="/" enctype="multipart/form-data" >
<input type="hidden" name="J:V-region-__page" value="/page2" />
<input type="hidden" name="J:V-region-__page.foo" value="4" />
---------- client submits action
{"path":"/__jifty/webservices/xml","actions":{"create_user":{"moniker":"create_user","class":"TestApp::Plugin::SinglePage::Action::CreateUser","fields":{"name":{"value":"4"},"email":{"value":"orzorz at of"},"email_confirmed":{"fallback":"0"}}},"auto-e04fb2080eaf81eb7483ef274bea95cd-1":{"moniker":"auto-e04fb2080eaf81eb7483ef274bea95cd-1","class":"Jifty::Action::Redirect","fields":{"url":{"fallback":"/index.html"}}}},"fragments":{"__page":{"name":"__page","path":"/page2","args":{"":"Next","foo":"4"},"parent":null}},

"variables":{"region-__page":"/page2","region-__page.":"Next","region-__page.foo":"4"},"continuation":{}}
---------- action taken, redirect to first page
<form method="post" action="/page2" enctype="multipart/form-data" >
<input type="hidden" name="J:V-region-__page.foo" value="4" />
---------- all gone crazy
{"path":"/__jifty/webservices/xml","actions":{},"fragments":{"__page":{"name":"__page","path":"/page2","args":{"":"Next","foo":"1","J:V-region-__page.foo":"4","J:V-region-__page.foo=4":"Next"},"parent":null}},
"variables":{"region-__page":"/page2","region-__page.":"Next","region-__page.foo":"1","region-__page.J:V-region-__page.foo":"4","region-__page.J:V-region-__page.foo=4":"Next"},"continuation":{}}

Can someone familiar with the use of state variable clarify?  is it
supposed to hold up all region's varible we've ever seen as fully
qualified form?

Cheers,
CLK




More information about the jifty-devel mailing list