Scenario: (webform 7.4) A multi page form with an address field on the second page, field has been saved and the form has been either submitted or saved as a draft. The submission (or draft) is viewed and the address field is there. The data in table {webform_submitted_data} shows as (I replaced my actual address for privacy):
a:6:{s:12:"thoroughfare";s:21:"MY ADDRESS 1";s:7:"premise";s:0:"";s:8:"locality";s:7:"CITY";s:19:"administrative_area";s:2:"MY PROVINCE";s:11:"postal_code";s:7:"MY POSTAL CODE";s:7:"country";s:2:"MY COUNTRY";}
Action: Attempt to edit the submission (or draft). Navigate to the second page of the form. The address field(s) are populated with the data as expected. If I then leave the edit form without saving, the address fields are wiped out except for the country, but that is because my default country value is set to CA.
Result: The address fields are wiped out when a draft or submission is edited but not saved. The data in table {webform_submitted_data} for the exact same field now shows as:
Array
I'm guessing that a step was missed here as it looks like the array wasn't converted back to text?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | aft-draft_loss-2335693-5.patch | 599 bytes | markie |
Comments
Comment #1
thisisnotrealpeople commentedErrors in logs:
Notice: unserialize(): Error at offset 0 of 5 bytes in addressfield_tokens_webform_submission_load() (line 423 of /sites/all/modules/addressfield_tokens/addressfield_tokens.module).
Comment #2
thisisnotrealpeople commentedI commented out line 426 in addressfield_tokens.module:
//drupal_array_set_nested_value($submission->data, $parents, $addresses);
and it works now?
I am confused as to why this was happening in the first place. I tried to replicate the issue with a brand new webform and wasn't able to make the values disappear.
Comment #3
pcambraRelated: #1600920: Module causes non-address webform fields to not show
Comment #4
joe-b commentedRelated: #1828426-2: Notice: unserialize() [function.unserialize]: Error at offset 0 of 5 bytes
Comment #5
markie commentedSo looking at this function and the call, if the $addresses variable is empty, the resulting called function is sad that the value is set to an empty array. Created a small patch for your testing pleasure.
Comment #6
markie commentedWent ahead and added this patch. Should be in the dev build soon.