drush en entity_translation -y
The following extensions will be enabled: entity_translation
Do you really want to continue? (y/n): y
PHP Fatal error: Unsupported operand types in /entity_translation/entity_translation.module on line 188

Fatal error: Unsupported operand types in /entity_translation/entity_translation.module on line 188
Drush command terminated abnormally due to an unrecoverable error.

$entity_info[$entity_type]['entity keys'] += array('translations' => 'translations');
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

atin81’s picture

Same error here using dev version, and same error on beta3 version but on line 187

plach’s picture

Status: Active » Postponed (maintainer needs more info)

Does this happen on a clean installation? If not please post the steps to replicate the error.

atin81’s picture

In my case the problem was originated by not having enabled the comment module. After enable comment module I could install this one with out problem.

Jānis Bebrītis’s picture

I stumbled access the same issue, fixed it by enabling comment module *before* enabling entity_translation.

my fix was creating array key when it doesn't exist, works fine, probably fixes other entities aswell, possibly related to #2001668: Location breaks entity translation

    $entity_info[$entity_type]['entity keys'] += array('translations' => 'translations');

My fix

    if (!isset($entity_info[$entity_type]['entity keys'])) $entity_info[$entity_type]['entity keys'] = array();
    $entity_info[$entity_type]['entity keys'] += array('translations' => 'translations');
Jānis Bebrītis’s picture

SocialNicheGuru’s picture

is there anyway to print which module does not have an entity bundle defined to watchdog?

plach’s picture

It's weird that the comment module is causing troubles: there's a check about it being installed (see entity_translation_entity_info())

plach’s picture

Status: Postponed (maintainer needs more info) » Needs review
Jānis Bebrītis’s picture

it was comments, i did print_r and it broke on it.

atin81’s picture

Same here, I did several testing to find that the problem was originated by comments module.

guillaumev’s picture

Had the same issue and the patch in #5 fixed it.

dkingofpa’s picture

Patch in #5 fixed the issue for me. I just updated it to follow drupal coding conventions.

basillic’s picture

#12 works for me.

An alternative coding style would be:
$entity_info[$entity_type]['entity keys']['translations'] = 'translations';

Helrunar’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #12 works for me

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks.

Status: Fixed » Closed (fixed)

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