Parent/child: has_parent filter must take parent filter into account when executing the inner query/filter.

Closes #8020
Closes #7943