I'm using Feeds (7.x-2.0-alpha8+56-dev) and it's experimental Entity Processor to import Mongo Node (latest 7.x-1.x) entities.
These entities are translated later using Entity Translation (7.x-1.0-beta4).
I had a problem with the language of the entity being set correctly in the entity itself,
but the associated record in the entity_translation database table was not considering that language,
thus it was incorrectly set based on the default value selected at admin/config/regional/entity_translation (default / current / author / etc.) without the possibility to override that default value from the feeds mappings.
Based on the code from entity_translation/includes/translation.handler.inc line 790
public function getLanguage() {
if (!empty($this->entityInfo['entity keys']['language'])) {
$language_key = $this->entityInfo['entity keys']['language'];
if (!empty($this->entity->{$language_key})) {
return $this->entity->{$language_key};
}
}
...
I came up with a fix to the mongo_node entity declaration,
which specifies the language key used, so that can be considered by entity translate:
'entity keys' => array(
'id' => 'mid',
'label' => 'title',
'bundle' => 'type',
'language' => 'language',
),
Attached is a small patch.
| Comment | File | Size | Author |
|---|---|---|---|
| mongo_node-support-entity_translation.patch | 372 bytes | reszli |
Comments
Comment #2
mihai_brb commented