Only trigger the access rights batch when a term is edited if the relevant fields have changed.
When we edit a term, we also trigger a batch operation to recalculate the access rights of any node connected that has the term.
However, we do it for all changes of the term (including the term name, weight, etc) so we end up doing this operation way more than needed.
The change in this PR will instead detect, when a term is being changed, that the change is relevant for the access control, and only then trigger the batch operation.
To test:
- try to edit a term's name for example (pick a term with some nodes attached), and save it -> no batch should trigger
- update the roles field -> batch should trigger
- update the users field -> batch should trigger
- rearrange the terms weight on the vocabulary page -> no batch should trigger
Edited by Mario Vercellotti