So, if I'm right this module only works for the autocomplete widget, but not for others (like select or radio).
Anyone here who already made that possible or knows of another module to get all widget types or even select/radio translation aware?

Comments

derMatze created an issue. See original summary.

chrlvclaudiu’s picture

Hi,

This is what I had in mind when I first saw this module. But don't worry, by using the same approach you can build the implementation to support "select" widgets as well. Just override the EntityReferenceHandler::getReferencableEntities() and add a language filter there. Perhaps I'll have some time do create a patch for this.

Good luck.

capellic’s picture

I too would love it if this module removed the entities from radio/checkbox/select lists. And just to be clear, while it doesn't filter it out, it will throw an error if you select an entity that isn't allowed:

"The referenced entity (node: 1886) is invalid."

capellic’s picture

I created a patch to support the select and radio widgets. I didn't test checkboxes.

rob c’s picture

Nice work! I'll test that next week capellic!

Just dropping a note about https://www.drupal.org/project/entityreference_view_widget because now that we have checkboxes, radios, selects and autocomplete, we might also want to look into other modules that could benefit? Would be great if all these support the idea behind translated_entityreference (Ability to filter per language of the parent entity).

awolfey’s picture

Adding an update of this patch that fixes the same issue that was in #2207107: Undefined variable: entity_info.