This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

kriz51732
kriz51732

Hi everyone

I have this fields.yaml:

fields:
   title:
       label: Titel
       span: auto
       required: 1
       type: text
   act:
        label: Blok
        nameFrom: id
        span: auto
        type: relation
        comment: 'Vul de id van het blok in waarin deze moet verschijnen'
    desc:
        label: Beschrijving
        size: small
        span: full
        required: 1
        type: textarea

But when I try to save any new entry, I get the message:

"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY' (SQL: insert into `*********_activiteiten_subactiviteiten` (`title`, `id`, `desc`) values (test, 1, test))" on line 664 of /home/******************/public_html/new/vendor/laravel/framework/src/Illuminate/Database/Connection.php

Why does it try to populate the 'id' column and not the 'act' column as stated in fields.yaml? Of course, the id column is primary and auto incrementing, so it should be populated automatically

Anyone knows the reason of this peculiar behavior?

Thanks in advance

Last updated

Flynsarmy
Flynsarmy

Correct, this is not normal behaviour. The id should not be specified when creating a new record, especially if it is not defined in the form fields. Maybe you have a plugin that is interfering.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.