V8-archive: Deleting item with o2m field error occur: This value should not be blank.

Created on 30 Aug 2019  路  2Comments  路  Source: directus/v8-archive

Steps to Reproduce

artists one-to-many with artworks

  • artists fields:

    • o2m field, not required`

    • status with publish, draft, soft delete

  • Add an artist item without the artworks
  • Update artists o2m field as required
  • Try to delete the artist created previously

Expected Behavior

Error: artworks: This value should not be blank.

Actual Behavior

It should delete the item successfully.

Other Context & Screenshots

Screenrecording

Technical Details

bug duplicate enhancement help wanted

All 2 comments

Here is my understanding of what is happening:

  1. You are trying to delete an item that has a required field that is empty
  2. Since you have a status field, it is actually updating the item with a new status, not (hard) deleting it
  3. The delete (actually an update) fails because the required field validation fails

I thought we already had a ticket for this, but I can't find it. So I added a new one: https://github.com/directus/api/issues/1237

My solution is to choose which status options enforce the required field validation with a new Status Mapping flag. Does this all seem correct to you?

Thank you so much for reporting this @JbalTero! I guess technically this isn't a bug, but a Feature request... but I agree that it certainly _seems_ like a bug. I'll close this one, and you can track the other ticket I created. Hopefully we can get this in soon!!

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

binary-koan picture binary-koan  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

chintohere picture chintohere  路  3Comments

metalmarco picture metalmarco  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments