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.

CommentFileSizeAuthor
mongo_node-support-entity_translation.patch372 bytesreszli

Comments

  • vladady committed e53036d on 7.x-1.x authored by reszli
    Issue #2467467 by reszli: Entity translation support with Feeds import.
    
mihai_brb’s picture

Status: Active » Closed (fixed)