Noticed while testing federation code. Test setup was: Repo 1 ("main") provides properties, Repo 2 provides items.
When using properties from "main" on repo 2, statement data for the item is missing the repository prefix, see excerpt from the "claims" part of item data:
{"P2":[{"mainsnak":{"snaktype":"value","property":"P2","datavalue":{"value":{"entity-type":"item","numeric-id":2,"id":"Q2"}
Repository name is correctly stored in the database.
First suspect is that while StatementModificationHelper::getEntityIdFromString is parsing the serialized ID, the parser for some reason drops the prefix (maybe maps it to an empty prefix).
This behaviour must be investigated. If fixing the problem turns out to be complex, please file a separate ticket outlining the solution.
Patches for review: