LPS-51059

I have not tested this fix at all.

Can you double check this one works?

Also, make sure you test with a list of categoryIds that don't all belong to the same group. I am not 100% if things work well I in AssetCategoryLocalServiceImpl.deteleCategories if I am calling the rebuildTree multiple times there...

Finally, see how I break my fix in smaller commits and describe what every commit is doing. It makes things much easier for others to read if you can follow this pattern for any of your commits. Just easier for people to understand what you're doing than simply commiting one big commit with all your changes...

Thanks,