uwazi
uwazi copied to clipboard
[IX] Review the usages of entities.saveMultiple
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:
- accepting a suggestion for a property that is inherited through a relationship will not update the denormalized value
The task is:
- review the saveMultiple functionality to see what is missing
- review it's usages to see whether the missing functionality might cause an error
- consider a solution
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.