Problem/Motivation
When editing a taxonomy term which has more than one parent, where one of the parents is root, root will be lost on save.
Steps to reproduce:
- Create a term (term1).
- Create another term (term2) which has the parents set to root and term1.
- Edit term2, save without editing the parents.
- Term2 will now only have one parent, term1. It would've lost root as a parent.
This is because when loading a terms parents it loads an array of terms, root is not a term so this doesn't get loaded.
Proposed resolution
Don't assume a parent is always a term entity.
Remaining tasks
- Reroll the latest patch based on 9.4.x.
- Manual testing after patch can be applied.
- Patch needss review