Duplicate entry for key 'block_content_field__uuid__value'

Created on 15 August 2019, over 5 years ago
Updated 30 June 2023, over 1 year ago

Problem

Reusing the same layout from the library with existing custom Inline Block causes duplicate entry in database.

How to Reproduce

  1. Add Layout
  2. Add custom block content to section
  3. Add two separate entities with new layout selected
  4. Second entity will fail

Error

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3cf3c837-5e04-4feb-b446-47b84e058a3f' for key 'block_content_field__uuid__value': INSERT INTO {block_content} (revision_id, type, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => basic [:db_insert_placeholder_2] => 3cf3c837-5e04-4feb-b446-47b84e058a3f [:db_insert_placeholder_3] => en ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 847 of /app/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
πŸ› Bug report
Status

Needs review

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brandonratz

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024