huridocs / uwazi

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

[IX] Review the usages of entities.saveMultiple #6686

Closed LaszloKecskes closed 2 months ago

LaszloKecskes commented 5 months ago

We have an old entities.saveMultiple function, which is an old function that does not contain all hooks that the singular save function does (in order to be more efficient). Most notably, the denormalization functionality is not triggered by it.

On a cursory glance, it is currently used in the places: in setting permissions, and accepting suggestions in IX. Not having these extra actions might cause problems in the future, for example:

The task is:

Since these usages are most likely getting input through user interaction, and thus will have short inputs, a simple solution would be just remove this saveMultiple function and save those entities one by one, as we usually do in other places in Uwazi.

### Tasks
txau commented 5 months ago

Is this also used when editing multiple entities at once?

LaszloKecskes commented 5 months ago

No, this is only used in those two places mentioned in the issue: setting permissions, and accepting suggestions.

LaszloKecskes commented 3 months ago

The current development for relationship support (#6800) to IX needed half of this change to properly handle title and inherited value denormalizations on suggestion acceptance. After that PR is merged, this will only have the permission part remaining, so it makes sense to take a look at it to close this issue.