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).

Comments

marty.true created an issue. See original summary.

marty.true’s picture

Issue summary: View changes
solardog’s picture

I 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?

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /modal_forms/ajax/webform/45
StatusText: Service unavailable (with message)
ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1101' 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] => 1101
[:db_insert_placeholder_1] => a1490ac40caf43fb4014cd6b5aeaa09d
[:db_insert_placeholder_2] => 1490104829
[:db_insert_placeholder_3] => 1490364029
[:db_insert_placeholder_4] => 0
)
in drupal_write_record() (line 7383 of /home/xxxxxxx/public_html/includes/common.inc).
LChun’s picture

StatusFileSize
new1.06 KB

I'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.

LChun’s picture

LChun’s picture

LChun’s picture

LChun’s picture

LChun’s picture

dtamajon’s picture

StatusFileSize
new1.97 KB

I 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.

dtamajon’s picture

StatusFileSize
new1.9 KB

I have updated the patch with a minor fix.

berliner’s picture

Status: Active » Needs review