Setup :
- 2 languages (EN as main, FR as translation)
- Localization by String Translation
- Expose webform component strings suitable for translation checked
- Keep a single webform across a translation set. checked
- Redirection location : Confirmation page - this is important, because if you set it to something else, you cannot see the bug
After posting a form in FR, you have an error in webform_localization_webform_submission_load(&$submissions) because there is no submission, so the Query condition $query->condition('s.sid', array_keys($submissions), 'IN'); blows up.
So here is a simple patch that returns if no submissions
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | webform_test.zip | 1.59 KB | coleman.sean.c |
| webform-submission-load.patch | 604 bytes | guile2912 |
Comments
Comment #1
rv0 commentedI had the same error multi-page forms in 7.x-1.x when "saving a draft between pages"
patch does not fix it (well, it fixes the error, but does not target the problem)
fixed with #2007756: Unable to save draft between pages on a multipage webform using a single form across the translation set
Comment #2
coleman.sean.c commentedRan into this bug by calling
webform_get_submission()from my module code. Any time you attempt to get a non-existent submission,webform_localization_webform_submission_load()gets passed an empty array, and fatals. I can confirm that the patch fixes this issue.Comment #3
rv0 commented@coleman.sean.c
please try the patch in the linked issue in #1
the patch here does not target the problem.
Comment #4
coleman.sean.c commentedRespectfully, the problem you describe in the other thread is unrelated to this issue, although they have similar symptoms. I've done some more thorough testing, and found that this patch addresses the bug, and the patch in the other issue does not.
To isolate this particular bug, from a stock Drupal install with the minimal profile, enable
webform, and a module that does the following:With just
webform, the 'minimal' profile, and the dependencies forwebform_localization,webform_get_submission()returns FALSE, and the page loads.With
webform_localizationenabled, the page crashes.With
webform_localizationenabled and the patch from #2007756-1: Unable to save draft between pages on a multipage webform using a single form across the translation set applied, the page still crashes.With
webform_localizationenabled and the patch from this issue applied, the page loads correctly.I've attached my test module if anyone wants to replicate my results.
Comment #5
rv0 commentededit: nvm
this patch wil indeed fix your issue (though not the one this thread is about, but it wont do any harm to have this code in there)
Comment #6
rajab natshahThanks :)
Comment #7
GDrupal commentedI'm not being able to replicate this issue, seems to me that looking into current webform code the submissions array should never be empty in first place. Anyway the patch will do any harm ;) , thanks you all guys.