Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Created on 16 May 2025, about 2 months ago

Problem/Motivation

When adding new content to the table, if the added entity has the same id as another entity, it gives this error: "Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '148466' for key 'co2_info.PRIMARY': INSERT INTO "co2_info""

Steps to reproduce

  1. Try to create a new content of another type of entity, that is not a node - Taxonomy Term or User.
  2. When recording this new entity, if this entity has the same id as another Node entity
  3. After recording the new entity, the following error appears in the browser: "Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '148466' for key 'co2_info.PRIMARY': INSERT INTO "co2_info""
🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇵🇹Portugal claudiadesiderio

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024