i was not able to use entity translation module if the wsclient module is enabled.

more info at http://drupal.org/node/1837056

CommentFileSizeAuthor
#3 wsclient-not-fieldable-1838846-3.patch447 bytesklausi

Comments

designfitsu’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta2

Anyone has fix for this yet? We run into the same issue.

gmaheux’s picture

On one of my project I encountered the same error as you.

It is impossible to use wsclient module when using entity_translation module. More meaningful, when I create the first webservice with wsclient module and then we try to create a new entity or activate a module, we have :

Drupal logs : Undefined index: translations in EntityTranslationDefaultHandler :: loadMultiple ()

and just after, apache logs : Fatal error: Can not access empty property in sites / all / modules / contrib / entity_translation / includes / translation.handler.inc on line 343.

This error comes from the fact that entity_translation module uses in his hook_entity_info_alter(&$entity_info), the translation parameter to define whether it should or should't translate this entity. Check hook_entity_info() function.

To work around this error, I applied in one of my custom module, which is dependent of wsclient module, the following code :

function hook_entity_info_alter(&$entity_info) {
  if (module_exists('entity_translation') && isset($entity_info['wsclient_service'])) {
    $entity_info['wsclient_service'] += array('translation' => array());
  }
}

At this time I don't need to have some options in translation parameter of this entity for my webservice but i think it's possible to work on this option directly in the hook_entity_info() of wsclient module.

klausi’s picture

Status: Active » Needs review
StatusFileSize
new447 bytes

Hm, I think this might be triggered due to the fact that wsclient entities are marked as fieldable, which does not make much sense.

Let's disable fields for wsclient_service configuration entities. Does the following patch fix the issue?

gmaheux’s picture

This patch fix the issue. I saw this fieldable option but i thought that there was a reason to have this at true.
Thanks for the patch.

klausi’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs review » Fixed

Committed, thanks for the feedback!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.