Fixed problem with refs #10811.

When 'to_field' specified with FK, then need to check pk value of object passed.