Fix/work package parent errors

Fixes https://www.openproject.org/work_packages/2399.