huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
242 stars 80 forks source link

Filters form error when draggin root items into groups #6714

Closed Zasa-san closed 6 months ago

Zasa-san commented 6 months ago

Describe the bug In the v2 filters form, if you drag a root item into a group, there will be a validation error on save.

To Reproduce Steps to reproduce the behavior:

  1. Go to the filters form table in settings
  2. Create a group
  3. Crate root items
  4. Save
  5. Drag a root item inside a group
  6. Save
  7. See error

Expected behavior Always save corretly

Additional context This occurs only when dragging existing root items inside a agroup since they preserve their _id. Root items and groups have _id, but the children do not. So a sanitization is needed for this case.