При включении PHP 7.2 на хостинге, ошибка Parse Error php_eval()

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

Аватар пользователя CoolSerg CoolSerg 26 мая 2019 в 15:01

Добрый день!
Начал разбираться с D7, перелопатил все патчи под PHP 7.2 , не помогают.
При включении ПХП 7+ на хостинге, падает сайт с ошибкой :
ParseError: syntax error, unexpected '>' в функции php_eval() (строка 1 в файле /var/www/vhosts/tasimal.kz/httpdocs/tasimal.kz/modules/php/php.module(80) : eval()'d code).

Если перетащить фильтр в форматах ввода вверх, ничего не меняется.

Подскажите что делать.

Лучший ответ

Аватар пользователя ivnish ivnish 26 мая 2019 в 15:02

Смотрите кастомные блоки с PHP-кодом и избавляйтесь от них (переносите код в препроцессы темы или кастомные модули)

Комментарии

Аватар пользователя ivnish ivnish 26 мая 2019 в 15:02

Смотрите кастомные блоки с PHP-кодом и избавляйтесь от них (переносите код в препроцессы темы или кастомные модули)

Аватар пользователя CoolSerg CoolSerg 26 мая 2019 в 15:06

Спасибо!
Вся проблема в обработчике PHP, буду думать что заменить в коде :

(function($) {
$(document).ready(function(){
$("#block-block-10 li div .active").parents(".item-list1 .item-list").parent().children("a").addClass('active').parent().children('div').show();
});
})(jQuery);

<?php
$term_parent = (object)array('tid'=>0);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(arg(1));
if($node->type == 'product') {
$items = field_get_items('node', $node, 'field_product_category');
$term = (object)$items[0];
$term_parent = taxonomy_term_load($term->tid);
}
}

/**
* Return rendered taxonomy tree
*/
function mymodule_taxonomy_tree($vocabulary_name, $term_parent) {
$vid = taxonomy_vocabulary_machine_name_load($vocabulary_name)->vid;
$terms = taxonomy_get_tree($vid);
return theme('item_list', array('items' => _mymodule_taxonomy_tree($terms, 0, $term_parent)));
}

/**
* Helper for mymodule_taxonomy_tree()
*/
function _mymodule_taxonomy_tree($terms, $parent = 0, $term_parent) {
$items = array();

foreach ($terms as $term) {
if (in_array($parent, $term->parents)) {
if($term_parent->tid == $term->tid)
$items[] = array(
'data' => l('' . $term->name . '','taxonomy/term/' . $term->tid, array('html' => true, 'attributes'=>array('class'=>array('active')))),
'children' => _mymodule_taxonomy_tree($terms, $term->tid, $term_parent),
);
else
$items[] = array(
'data' => l('' . $term->name . '','taxonomy/term/' . $term->tid, array('html' => true)),
'children' => _mymodule_taxonomy_tree($terms, $term->tid, $term_parent),
);
}
}

return $items;
}

echo mymodule_taxonomy_tree('product_category', $term_parent);
?>

Аватар пользователя ivnish ivnish 26 мая 2019 в 15:08

Вам не этот код заменить, а убрать его из блока совсем. Код должен быть или в препроцессах темы оформления или в кастомном модуле. Но никак не в блоке.