Trying to use WPD with Bounce Convert which uses Modal Forms and when hitting the submit button, it throws an error:
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /modal_forms/ajax/webform/133
StatusText: Service unavailable (with message)
ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9' for key 'PRIMARY': INSERT INTO {wpd_access_hashes} (sid, hash, processed, expires, used) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
(
[:db_insert_placeholder_0] => 9
[:db_insert_placeholder_1] => 937b90f6267bfde63ff57e7f5872e4d3
[:db_insert_placeholder_2] => 1478200354
[:db_insert_placeholder_3] => 1478805154
[:db_insert_placeholder_4] => 0
)
in drupal_write_record() (line 7376 of /home/XXXXXX/public_html/includes/common.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | webform_protected_downloads_2824728_2.patch | 1.9 KB | dtamajon |
| #4 | wpd_modal_form_fix.patch | 1.06 KB | LChun |
Comments
Comment #2
marty.true commentedComment #3
solardog commentedI am having the same issue. I did not change anything on my end and the error has seemingly come out of the blue. Greengeeks shared hosting suggested an issue with my PHP version (currently 5.6). I tried PHP 7 but no joy.
Anyone have any idea what might be causing this issue?
Comment #4
LChun commentedI've had the same problem with this module and modal forms. I'm not sure where the true issue lies, but I created a workaround patch.
It seems that somehow the submission process for this module is being run twice, creating the duplicate entry. I've added a function to stop it running the second time.
Comment #5
LChun commentedComment #6
LChun commentedComment #7
LChun commentedComment #8
LChun commentedComment #9
LChun commentedComment #10
dtamajon commentedI have the same problem... As @LChun pointed, the hook_form_alter is called twice, and either could not find why is happening.
I have created a patch to get an ajax response, so after the call is processed, the response is the confirmation message.
I could not get a better way to do it... maybe modal_forms mainteners can help to make the module compatible in a better way.
Comment #11
dtamajon commentedI have updated the patch with a minor fix.
Comment #12
berliner commented