Hi All,
I have been experiencing this issue for a long time, however I was not sure of the cause so I could never replicate it until today.
I have a 2 page form with a db save and redirect after the 2nd page. Everything works well in normal circumstances. However, when the form is loaded in a Firefox private window or when the cookies are disabled for the page all data gets lost just before the redirect. The debug shows that the array is there on the 2nd page but after clicking the submit button everything is lost and just an empty record gets saved into the db.
This is on the second page:
And this happens after the redirect:
Has anyone got an idea how to fix this?
Regards
Bob
I have been experiencing this issue for a long time, however I was not sure of the cause so I could never replicate it until today.
I have a 2 page form with a db save and redirect after the 2nd page. Everything works well in normal circumstances. However, when the form is loaded in a Firefox private window or when the cookies are disabled for the page all data gets lost just before the redirect. The debug shows that the array is there on the 2nd page but after clicking the submit button everything is lost and just an empty record gets saved into the db.
This is on the second page:
Array
(
[chronoform] => land-registry-search-testing
[event] => page2
[ordered-doc] =>
[flat-number] => test
[street] => test
[town] => test
[postcode] => test
[ownersname] =>
[titleno] =>
[comments] => test
[contactname] => test
[email] => test@test.com
[confemail] => test@test.com
[status] => unpaid
[button9] => Continue ❱
[amount_paid] => 0
[payment_fee] => 0
[additional_searches] =>
[paypal_items] =>
)
And this happens after the redirect:
ArrayAnd the empty record in the db:
(
[chronoform] => land-registry-search-testing
[event] => submit
[checkbox56] => 1
[button67_x] => 92
[button67_y] => 21
[id] => 672765
)
Array
(
[48] => Array
(
[DB Save] => Array
(
[Queries] => Array
(
[0] => INSERT INTO `tclq3_chronoengine_chronoforms_datatable_landregistrytitlesea` (`user_id`, `uniq_id`, `created`) values ('0', '591462c0bb489c9f019ba08ad5d2a67be54687c1', '2020-05-19 05:41:16');
)
)
)
)
Has anyone got an idea how to fix this?
Regards
Bob
Hi Bob,
In the cases you describe the User Session data won't be preserved between pages. My preferred way of doing this is to write the data to the database when page 1 submits with an 'incomplete' status and add the record ID to the page data in a hidden input. Then when page 2 is submitted you can re-load the data from page one, complete the processing, sae the full data and update the status to 'complete'.
Bob
In the cases you describe the User Session data won't be preserved between pages. My preferred way of doing this is to write the data to the database when page 1 submits with an 'incomplete' status and add the record ID to the page data in a hidden input. Then when page 2 is submitted you can re-load the data from page one, complete the processing, sae the full data and update the status to 'complete'.
Bob
Hi Bob,
Thanks for your thoughts. Is it the only possible solution? I am trying to avoid saving the data before it is submitted because i will end up a lot of useless records and spam in my database.
If no other way then I guess, I will have to do it. Please could you tell me ho to add the record id to the page data?
Cheers
Bob
Thanks for your thoughts. Is it the only possible solution? I am trying to avoid saving the data before it is submitted because i will end up a lot of useless records and spam in my database.
If no other way then I guess, I will have to do it. Please could you tell me ho to add the record id to the page data?
Cheers
Bob
This topic is locked and no more replies can be posted.