Я недавно обновил сайт до Drupal 7.59 с профилем установки:
Commerce Kickstart (commerce_kickstart-7.x-2.54)
Ранее была функция, которая была добавлена вядро, которое сейчас удалено из-за обновления.Это не должно было быть добавлено к ядру, и я не уверен, почему это было.Я добавил эту функцию обратно, и она не выполняет то, что делала ранее, поэтому я не уверен, какие еще изменения мне понадобятся, чтобы заставить ее работать.
Вот функция, которая находится в /profiles/commerce_kickstart/themes/commerce_kickstart_admin/template.php
-
function commerce_kickstart_admin_commerce_price_formatted_components($variables) {
// Add the CSS styling to the table.
drupal_add_css(drupal_get_path('module', 'commerce_price') . '/theme/commerce_price.theme.css');
// Build table rows out of the components.
$rows = array();
foreach ($variables['components'] as $name => $component) {
$rows[] = array(
'data' => array(
array(
'data' => $component['title'],
'class' => array('component-title'),
),
array(
'data' => $component['formatted_price'],
'class' => array('component-total'),
),
),
'class' => array(drupal_html_class('component-type-' . $name)),
);
}
if($variables['components']['discount']['price']['amount']){
unset($rows[0]);
unset($rows[2]);
}else{
$rows = array_splice($rows, 2);
}
return theme('table', array('rows' => $rows, 'attributes' => array('class' => array('commerce-price-formatted-components'))));
}
Кто-нибудь может подсказать, как это работает?Это, кажется, даже не вызывается.
Дополнительная информация из комментариев:
it's a function in the profile?
да
Was the function added afterwards (as in "Never hack core")?
Да, похоже на это.
Or was it removed by the maintainers?
Не похоже, что это когда-либо было частью какого-либо официального релиза
Do you use some version control system like Git?
Да.Эта функция была добавлена 14.05.2015 12:18 в соответствии с репо.
Have you checked the profile's release notes and issue queue?
Посмотрел, но ничего не увидел.