Hello!
After upgrading to lates entity_translation -dev (2012-Feb-13) I began to receive error messages in some cases. For example after clearing all cache at admin/config/development/performance:

    Notice: Undefined index: base path in entity_translation_menu_alter() (line 162 of /var/www/sky37.pp.ua/public_html/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access callback in entity_translation_menu_alter() (line 207 of /var/www/sky37.pp.ua/public_html/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access arguments in entity_translation_menu_alter() (line 207 of /var/www/sky37.pp.ua/public_html/sites/all/modules/entity_translation/entity_translation.module).
    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in entity_translation_menu_alter() (line 207 of /var/www/sky37.pp.ua/public_html/sites/all/modules/entity_translation/entity_translation.module).

Drupal 7.12, Entity translation 7.x-1.x-dev (2012-Feb-13), Internationalization 7.x-1.4 (or i18n 7.x-1.4+2-dev (2012-Feb-14), doesn't matter). Probably this issue is related with adding ET menu support at i18n: http://drupal.org/node/1182058

Comments

colan’s picture

Can you post a backtrace for the first one?

renat’s picture

Experiment with backup showed, that this problem arose after upgrading Entity reference from 7.x-1.0-beta3 to 7.x-1.0-beta4. And

This release changed the schema of the field (dropping the target_type column. Features exporting this field will need to be manually fixed.

Obviously it has nothing to do with i18n Menu patch. More info can be found here:
http://drupal.org/node/1319040

colan’s picture

Status: Active » Closed (works as designed)
renat’s picture

Status: Closed (works as designed) » Active

Not sure it works as designed, though, probably, the problem is related with Entity Reference, not Entity Translation - but if it's true, we should reassign this issue to ER. Though maybe we should check ET, because in thread mentioned above it was stressed, that ER is fine, and that other modules will face problems only in case they store, that they shouldn't.

And now there are problems with these two modules even on clean installation. Let's install Drupal 7.12, Chaos tool suite (ctools) 7.x-1.0-rc1+116-dev (2012-Jan-23), Entity API 7.x-1.0-rc1, Entity reference 7.x-1.0-beta4 and Entity translation 7.x-1.x-dev (2012-Feb-13), and then add one more language to default English - say, Russian. Than we'll create new node type "TestType" with EntityReference field, able to create references to Articles, and with entity-translatable text field. Let's create some article, and then "TestType" node, referencing it, with some text in text field. When we'll translate that text field, we'll begin to receive notice message in some places (when clearing all cache, for example). Though it is different from messages printed above:
Notice: Undefined index: fieldable in field_ui_menu() (line 81 of /var/www/test.sky37.pp.ua/public_html/modules/field_ui/field_ui.module).

colan’s picture

Oh sorry, I thought you were saying that this issue didn't have anything to do with this module.

rv0’s picture

Not related to entity_reference,
Not using it and getting same error with latest dev

Entity API 7.x-1.0-rc1
ctools 7.x-1.0-rc1

renat’s picture

@rv0, interesting to know, which message do you receive exactly - as it was listed in #4, or in topic-starting message?

In my case it looks like there is connection with Entity Reference - I restored from backup unaffected copy of my site and began to upgrade modules one by one - and this problem appears after upgrading ER from beta3 to beta4. If to disable Entity translation after it, this problem goes away, if to re-enable - returns.

Moreover, there are a lot of people faced bugs after upgrading ER from beta3 to beta4: http://drupal.org/node/1438278 All of these bugs are caused by interference with other entity-related modules. They say these modules are not following this Entity API guidelines: http://drupal.org/node/1313238

Probably we should change implementation of hook_entity_info_alter()
, as it was done for Profile2 and Organic Groups here:
http://drupal.org/node/1290986#comment-5083708

rv0’s picture

@renat exact same message as in topic start.

renat’s picture

Status: Active » Closed (fixed)

Bug was successfully fixed at Entity Reference's side.

rv0’s picture

as said in #6, i wasnt using entity ref and i still had the same error.

must be other contrib then?

renat’s picture

@rv0, think you should provide additional information about your issue. At least it'll be useful to know, which operations triggers errors. Are there error messages, if to disable Entity Translation? When did this error appeared? In my case it was only after ER upgrade, had you this troubles from the very beginning?

rv0’s picture

Issue was with a fresh install of Entity Translation on an almost clean site.
Errors disappeared when uninstalling it. (which I did pretty quick).

I can't really say more about it, I don't remember exactly when they appeared because it was kinda vague, as top post says: In same cases. (eg: error appeared, refresh, no error anymore)
I cannot try to reproduce this now because the site was sent to the client 2 hours ago for feedback. Once the final bilingual content will be entered I will give ET an other go and I'll post back here.

Danny Englander’s picture

I think this also might be related to Fatal Error: Cannot access empty property

klonos’s picture

Component: Code » Base system
Status: Closed (fixed) » Active

I realize this has been closed back in #9 a couple of months ago, but I'm getting these errors using latest devs of both core and all related modules (update.php run, caches cleared and all):

The configuration options have been saved.

    Notice: Undefined index: base path in entity_translation_menu_alter() (line 162 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access callback in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access arguments in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Warning: array_merge(): Argument #2 is not an array in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: base path in entity_translation_menu_alter() (line 162 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access callback in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Notice: Undefined index: access arguments in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).
    Warning: array_merge(): Argument #2 is not an array in entity_translation_menu_alter() (line 207 of /var/www/my-site/sites/all/modules/entity_translation/entity_translation.module).

It happened on the entity translation admin page (/admin/config/regional/entity_translation) when I enabled translation for Taxonomy term, Comment, Field collection item, User & Rules configuration (Node was already enabled from previous configuration).

klonos’s picture

...I've narrowed this down to the offending modules and filed separate issues or found appropriate ones to follow:

#1344672: Field Collection: Field translation (entity_translation) support.
#1533284: Rules: Field translation (entity_translation) support.

Still, these errors seem to follow a pattern and the "common ground" is the entity_translation.module. Is there something we should/could do here?

mojzis’s picture

I've run into this problem with an entity created with eck, that has a bundle. So the router path is entitytype/bundle/% , while this module is only checking for entitype/% (in entity_translation_entity_info_alter - line 88 of entity_translation.module) :

        // If we cannot find a usable base path we skip to the next entity type.
        if (!isset($router["$entity_type/%"])) {
          continue;
        }

so nothing is iset for that entity type and the values are missing later (which also results in WSOD - #1370900: Fatal Error: Cannot access empty property in /sites/all/modules/entity_translation/includes/translation.handler.inc ).

I wonder what should be done for all the eventual bundles ? There cant be one simple path, but an array thereof ... will the EntityTranslationDefaultHandler handle it ?

chriscohen’s picture

Same issue as #16. The field_collection module does not have a specific $router["$entity_type/%"] set.

The module completely fails to deal with a situation where $translation_key is NULL, which causes the entire thing to break. It would be okay to throw an exception in this situation, but not dealing with it at all is not enough.

This is related to #1370900: Fatal Error: Cannot access empty property in /sites/all/modules/entity_translation/includes/translation.handler.inc so I thought I'd mention that here. Patch from #11 on that issue does work, but consequences unknown. Would be good to get this reviewed properly as it's a real blocker!

mojzis’s picture

Well, i ended up thinking that the problem is rather in eck, with the untraditional construction of the path (type/bundle/% instead of type/%loader). I tried to adress it in #1556094: translation, menu path, but no answer thus far :). I managed to write a simple menu & loader function for my property to be able to translate it. But if i get it right, even if you manage to translate it, you are not done, because it doesnt allways load the proper info, because of #1456186: Interaction of entity, entity_translation & title on entities without a language property. waiting for a core issue #1495648: Introduce entity language support.

plach’s picture

plach’s picture

Status: Active » Postponed (maintainer needs more info)

Please try the latest dev (a new snapshot will be out in 4 hours) and check whether the issue is now fixed.

plach’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Cleaning up the queue.
Reopen if needed.

plach’s picture

Issue summary: View changes

Added correct link to possibly corresponding topic.