Advanced forum, при создании или перемещении темы выдаёт ошибки

Главные вкладки

Аватар пользователя Холод Холод 25 сентября 2013 в 15:55

Вот такие вот ошибочки:

•Notice: Trying to get property of non-object в функции i18n_taxonomy_localize_terms() (строка 1037 в файле /home/u966952130/public_html/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module).
•Warning: array_flip(): Can only flip STRING and INTEGER values! в функции DrupalDefaultEntityController->load() (строка 173 в файле /home/u966952130/public_html/includes/entity.inc).
•Warning: array_flip(): Can only flip STRING and INTEGER values! в функции DrupalDefaultEntityController->cacheGet() (строка 350 в файле /home/u966952130/public_html/includes/entity.inc).

В первом случае "попытка получить не объективные свойства", во втором и третьем "можно использовать только обратные строки и целые значения". О чём вообще речь?
Приотключении подмодуля перевода таксономии ошибки остаются. Не могу понять с чем это связано. Подскажите пожалуйста.

Комментарии

Аватар пользователя Холод Холод 25 сентября 2013 в 16:54

1037 строка в файле /sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module вот

«if (i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE)) {
»
Вот так выглядит полностью:
«/**
* Localize taxonomy terms for localizable vocabularies.
*
* @param $terms
* Array of term objects or term object.
* @return
* Array of terms with the right ones localized.
*/
function i18n_taxonomy_localize_terms($terms) {
// If not localizable language just return. Performance optimizations.
if (!i18n_string_translate_langcode()) {
return $terms;
}
$object_info = i18n_object_info('taxonomy_term');
$list = is_array($terms) ? $terms : array($terms);
foreach ($list as $index => $term) {
if (i18n_taxonomy_vocabulary_mode($term->vid, I18N_MODE_LOCALIZE)) {
$localize[$index] = $term->tid;
}
}
// If multiple terms, preload all translations, then run object translation.
if (!empty($localize)) {
i18n_string_translation_search(array('taxonomy', 'term', $localize, '*'));
foreach ($localize as $index => $tid) {
$list[$index] = i18n_string_object_translate('taxonomy_term', $list[$index]);
}
}
// Return array or simple object, depending on incoming format.
return is_array($terms) ? $list : reset($list);

В чём состоит "попытка получить не объективные свойства"?

Аватар пользователя Холод Холод 25 сентября 2013 в 17:12

Строка 173 в /includes/entity.inc вот:
« $passed_ids = !empty($ids) ? array_flip($ids) : FALSE;»
Полностью:
« // Create a new variable which is either a prepared version of the $ids
// array for later comparison with the entity cache, or FALSE if no $ids
// were passed. The $ids array is reduced as items are loaded from cache,
// and we need to know if it's empty for this reason to avoid querying the
// database when all requested entities are loaded from cache.
$passed_ids = !empty($ids) ? array_flip($ids) : FALSE;
// Try to load entities from the static cache, if the entity type supports
// static caching.
if ($this->cache && !$revision_id) {
$entities += $this->cacheGet($ids, $conditions);
// If any entities were loaded, remove them from the ids still to load.
if ($passed_ids) {
$ids = array_keys(array_diff_key($passed_ids, $entities));
}

Вот строка 350:
« $entities += array_intersect_key($this->entityCache, array_flip($ids));»
Полностью:
« /**
* Gets entities from the static cache.
*
* @param $ids
* If not empty, return entities that match these IDs.
* @param $conditions
* If set, return entities that match all of these conditions.
*
* @return
* Array of entities from the entity cache.
*/
protected function cacheGet($ids, $conditions = array()) {
$entities = array();
// Load any available entities from the internal cache.
if (!empty($this->entityCache)) {
if ($ids) {
$entities += array_intersect_key($this->entityCache, array_flip($ids));
}
// If loading entities only by conditions, fetch all available entities
// from the cache. Entities which don't match are removed later.
elseif ($conditions) {
$entities = $this->entityCache;
}

Аватар пользователя Холод Холод 26 сентября 2013 в 17:07

Пробовал отключать-включать различные модули. Да, ошибка именно из-за Advanced forum. И не верю что кроме меня не использовал i18 с ним. Должен же был кто-то с этим сталкиваться. Ау!

Аватар пользователя Холод Холод 27 сентября 2013 в 17:50

Что бы не мучаться, просто удалил

<?phpif (array_diff_assoc($conditions, $entity_values)) {
?>

И вставил

<?php if (drupal_array_diff_assoc_recursive($conditions$entity_values)) {
?>

И ни каких изменений...