Fix client part of bug #9983
Fix set same resource as a parent
Fixed setting resource as it's own parent

* fix-own-parent:
  Fix set same resource as a parent
  Fix client part of bug #9983