Issue #2822923 by jhedstrom: Fixed Flagging uid base field not declared as an entity key, causing getOwnerId() to not work.