uwazi icon indicating copy to clipboard operation
uwazi copied to clipboard

Validate attachments referenced in entities' metadata

Open Zasa-san opened this issue 3 years ago • 0 comments

The work done in https://github.com/huridocs/uwazi/pull/4275 allows to send API calls that have new supporting files already referenced in a metadata image or media field. This avoids having to create/update the entity with supporting files first, and then save the entity again with the references to the supporting file in the media or image fields.

The following issues where detected during development:

  • And entity's metadata property can have a new value called attachment that references the index number of the new supporting file. Upon entity save attachment is used to form the value property pointing to the file, attachment is never saved on the database. Since value is as a mandatory property, when doing the API call, the user needs to send and empty value alongside attachment to pass validation. It would be better if value was not required if attachment is present.

  • The attachment property can be sent in any metadata property, but only image and media fields can reference files.

  • If the process to save the file fails, the entity will still have the reference to the file in the metadata.

Zasa-san avatar Feb 10 '22 17:02 Zasa-san