Only set idProperty if identifier provided, fixes #17557

(cherry picked from commit 5c86aadf89e576075dfb27898a7897112751edad)