Because we use multiple column to define primary key. When use data entity, we assign entity id to serial integer field with index (not primary key), it worked.

But when using entityreference to get ajax popup list, views result will use primary key to it's index. It should respect what we set in data entity interface.

When looked into code, we found that entity force primary key(and only first one) to be views base table, we have small patch for this to respect what we set in data entity.

Comments

jimyhuang created an issue. See original summary.

jimyhuang’s picture

Status: Needs work » Needs review
StatusFileSize
new829 bytes

This is our patch. To see if we can pass the test.

joachim’s picture

Version: 7.x-1.0-alpha7 » 7.x-1.x-dev
Status: Needs review » Needs work

Looks like a reasonable change, but this should be in data_entity_views_data_alter(), so in Data Entity and not in Data module.

jimyhuang’s picture

Status: Needs work » Needs review
StatusFileSize
new546 bytes

Move change to data_entity_views_data_alter. Patch here.

roderik’s picture

This should also fix the 'edit item' link in the view, in such situations.

I don't have the setup to test this right now (just stopping by to crosslink a few issues), but it seems to me like people using the 'edit' link will be confused with the unpatched module, if their (single or multi-field) primary key happens to be different from the entity ID.