Error with duplicated entry in webform issue in Drupal

Issue:

 Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'my_form-2' for key 'PRIMARY': UPDATE "webform" SET "next_serial"=:db_update_placeholder_0 WHERE "webform_id" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 2 [:db_condition_placeholder_0] => my_form ) in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 45 of core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php).

Fix:

Delete from webform where webform_id='my_form' and next_serial=1

Comments

Popular posts from this blog

Programatically create layout builder section in Drupal

Code quality analysis of Drupal. Can I use Sonar?

Set up Drupal7 to Drupal8 migration in simple steps (using Drush)