KamoCRM

Saving a form no longer rejects its own field IDs

Fixkamo-shared-library
Shipped
October 13, 2026 at 10:17 PM UTC
Author
Kamo
Commit
8ccd836

updateForm replaces every stack and field, but the field-ID check compared the request against the rows already stored. The editor sends no field id, so each kept field matched itself and failed with "Field ID '…' already exists in this form." (the exclude-self branch was inverted too). Uniqueness is now checked within the request alone. The replacement itself is made safe: fields are deleted and flushed before their stacks (both have foreign keys), the stacks leave form.stacks through orphanRemoval rather than being deleted while still held, and the new rows go into the managed collections so the returned form carries them.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing