As includes/common.inc says:
* @param $conditions
* (deprecated) An associative array of conditions on the base table, where
* the keys are the database fields and the values are the values those
* fields must have. Instead, it is preferable to use EntityFieldQuery to
* retrieve a list of entity IDs loadable by this function.

in i18n root dir:
grep -r . -e "entity_load" -n
./i18n_menu/i18n_menu.test:237: $translation_sets = entity_load('i18n_translation', FALSE, array('tsid' => $tsid), TRUE);
./i18n_menu/i18n_menu.test:285: $entity = entity_load('i18n_translation', FALSE, array('title' => $edit['title']), TRUE);
......
./i18n_translation/i18n_translation.module:276: $entity = entity_load('i18n_translation', FALSE,$conditions);

CommentFileSizeAuthor
#3 i18n_translation_set_load.patch1.11 KBjose reyero

Comments

suvisor’s picture

./i18n_translation/i18n_translation.module:276: $entity = entity_load('i18n_translation', FALSE,$conditions);
This issue is affected in such cases:
1: $ts_a = array( 1,2,3,4,5,6,7,8,9,10); // tsid-s. Exists in i18n_translation_set
2: foreach($ts_a as $ts) {
3: $t = i18n_translation_set_load($ts);
4: $t->delete(TRUE);
5: }

this code fails in 4 line with "Fatal error: Call to a member function ... on a non-object.". It is because entity_load "remember" (i'm do not imagine how) the first call AND all other calls will returns also first result (ie, result contains 2 element in array instead of 1).
More detailed:
when loading ts with ID 1 all works as expected;
when loading ts with ID 2 objects with id 1 and 2 are returned
when loading ts with ID 3 objects with id 1 and 3 are returned
.....

suvisor’s picture

Priority: Minor » Normal
jose reyero’s picture

StatusFileSize
new1.11 KB

Ok, give a try to this one.

jose reyero’s picture

Status: Active » Needs review
jose reyero’s picture

Status: Needs review » Fixed

Never mind, committed.

Status: Fixed » Closed (fixed)

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