Skip to content

SQL "Duplicate entry" error when inserting into glpi_documents_items with Formcreator #3606

@Windayz

Description

@Windayz

Hello,

I’m encountering an error when using the Formcreator plugin on GLPI (last release):

MySQL query error: Duplicate entry '6483-PluginFormcreatorFormAnswer-15445-0' for key 'glpi_documents_items.unicity'

This error occurs when the plugin tries to insert a relation between a document and a form answer, but the database rejects it because this entry already exists.

Context:
GLPI version: 10.0.18
Formcreator version: 2.13.10

This error appears when creating or updating a form answer containing an attached document.

Expected behavior:
The plugin should properly handle duplicates, either by checking for existence before inserting or updating the existing entry.

Steps to reproduce:
Create a form with a file upload field.
Submit an answer with an attached document.
Submit the form again or update the answer.
The error occurs during the insert.

Logs and errors:

Image

Notes:
I did not observe any PHP errors related to upload size or other server issues, indicating the problem comes from duplicate handling in the database.

Thanks in advance for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions