Error when user has a second submission

Created on 4 August 2021, over 3 years ago
Updated 29 April 2024, 7 months ago

Problem/Motivation

I have a form where users can add several submissions. When I convert the submission into content, I get an error with the second submission that user does:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7' for key 'PRIMARY': INSERT INTO "node" ("nid", "vid", "type", "uuid", "langcode") 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] => 7 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => opdracht [:db_insert_placeholder_3] => 8ad19b73-4162-4a5c-80ff-a736f3fc5c95 [:db_insert_placeholder_4] => nl )

I have looked into the submission to content field mapping, but the field NID is not present and has always the same value for the same user. Any ideas what is going on and how to avoid this to enable user to post several submissions?

It seem related to the issue reported under https://www.drupal.org/project/webform_content_creator/issues/3220675 💬 Integrity constraint violation Closed: works as designed , but in this case I would like to have multiple submissions.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

🇳🇱Netherlands Picanha

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.

  • 🇵🇹Portugal joaomarques736

    Hello Picanha, Thanks for your request. Could you provide more details on the mapping ? Please notice that the content entity id (nid,tid,uid, etc..) can't be the same for different entities,so in the mapping the entity id can't be static or be mapped with some field that can be duplicated. Otherwise the module will throw an exception while trying to create the content, some custom handler or additional module should be used to do that validation, however this module is working as designed.

    Best regards.

  • Status changed to Closed: works as designed 7 months ago
Production build 0.71.5 2024