Probably need to see more code -- for grid page, component, and add_article.
On Thursday, June 28, 2012 5:29:40 AM UTC-4, Johann Spies wrote:
>
>
>
> On Wednesday, 27 June 2012 17:51:44 UTC+2, Anthony wrote:
>>
>> Perhaps form.process() is failing the first time because the _formkey in
>> the session isn't matching for some reason (don't know why, though).
>>>
>>>
>>>
> Anthony, I have investigated by putting a 'print session' in the
> controller and found this:
>
> First time:
>
> Firebug shows:
> <div class="hidden" style="display: none;">
> <input type="hidden" value="e502ec08-acf2-4b4e-ab93-7449c52efa97" name=
> "_formkey">
> <input type="hidden" value="akb_articles/create" name="_formname">
>
>
> And the 'print session' revealed:
>
> <Storage {'_formkey[akb_articles/create]':
> 'e502ec08-acf2-4b4e-ab93-7449c52efa97'}>
> <Storage {'_formkey[akb_articles/create]':
> 'e502ec08-acf2-4b4e-ab93-7449c52efa97'}>
> <Storage {'_formkey[akb_articles/create]':
> '3e834837-f578-45b4-9cc6-8105a7c9bacf'}>
>
>
> Then I reloaded
>
> Firebug:
>
> <div class="hidden" style="display: none;">
> <input type="hidden" value="6aed7bbb-0523-47ba-a83f-fb25931559cd" name=
> "_formkey">
> <input type="hidden" value="akb_articles/create" name="_formname">
>
> And the session:
>
> <Storage {'_formkey[akb_articles/create]':
> '3e834837-f578-45b4-9cc6-8105a7c9bacf'}>
> <Storage {'_formkey[akb_articles/create]':
> '6aed7bbb-0523-47ba-a83f-fb25931559cd'}>
>
> The history:
>
> From a component (selectable grid) in another screen, the submit button
> was clicked and a function in a module called which did the following:
>
> def gekose_skrywers(db, ids):
> import pdb
> request = current.request
> session = current.session
> if ids:
> session.ids = ids
> session.skrywers = set([x.uuid for x in db(db.akb_authors.id.
> belongs(ids)).select(db.akb_authors.uuid)])
> redirect(URL(r = request, c = 'articles', f = 'add_article'
> )
> )
> else:
> redirect(URL(r = request, c = 'default', f = 'index'))
> return
>
> How do I find out where that last _formkey in before the reload comes from?
>
> Regards
> Johann
>
>