Our site will have a database of games, each with a unique integer ID. There will then be reviews which reference these games. I have a table that stores the game information, and have this defined as an entity type with the game's id as the entity id. I have selected the game's name as the label under "Configure Entity Form." In the review content type, I have an entity reference field for the game, with the table entity as the target type, using simple mode. Now, regardless of whether I use a select list, checkboxes, or autocomplete, the label displayed is "- Restricted access - ". It does work, as when I select one, I will get the result I was expecting (using autocomplete) but it's not very useful to not be able to actually see the name of the game I'm selecting.
I feel like this should be a simple configuration change, but I haven't been able to locate it yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | data-entity-access-fix-2277381-5-D7.patch | 711 bytes | chewie |
Comments
Comment #1
gabtrek commentedHi, I have the same problem here. Same example, same behavior.
Please, help!
Thanks.
Comment #2
kscheirerAs far as I can tell, it's because there's no access callback defined for the entities. There's a call to
entity_access('view', $target_type, $entity)that always fails, so you get the default string "- Restricted access -".The best solution would be to provide some sort of default access callback for all entities defined by data module. Or maybe you can add one with hook_entity_info_alter().
The workaround that I used was to set the entityreference field to use a view instead of simple entity selection. This would be the "Entity Selection" settings on the field. I created a simple view that returned the entity titles and use it on the field settings, seems to work fine.
Comment #3
joachim commented> The best solution would be to provide some sort of default access callback for all entities defined by data module.
Agreed.
Comment #4
giorgoskmaybe its also related to this #2153463: Restricted access results with user entityreference
Comment #5
chewie commentedHope this patch will help.
This is most simple solution for now.
Comment #6
jerry commentedWorking fine here. Let's RTBC it.