Revert "Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader""

This reverts commit 5009b078875e596a2fba7827336f7548aa6e35ac.

Also updated the CHANGELOG and adjusted the test-case to match the one on master.