path_to_location now returns 404 on orphaned items. Resolves LMS-9661.
Merge pull request #4896 from Kelketek/fix_path_to_location

path_to_location now returns 404 on orphaned items. Resolves LMS-9661.