1

我正在尝试将 Drupal6 主题转换为 Drupal7,并尝试进行必要的更改。但我收到错误 致命错误:第 1075 行 /includes/theme.inc 中不支持的操作数类型 第 1075 行是 $variables += $info['variables'];

我的template.php文件如下

function template_preprocess_search_theme_form(&$variables) {
  $variables['search'] = array();
  $hidden = array();
  // Provide variables named after form keys so themers can print each element independently.
  foreach (element_children($variables['form']) as $key) {
    $type = $variables['form'][$key]['#type'];
    if ($type == 'hidden' || $type == 'token') {
      $hidden[] = drupal_render($variables['form'][$key]);
    }
    else {
      $variables['search'][$key] = drupal_render($variables['form'][$key]);
    }
  }
  // Hidden form elements have no value to themers. No need for separation.
  $variables['search']['hidden'] = implode($hidden);
  // Collect all form elements to make it easier to print the whole form.
  $variables['search_form'] = implode($variables['search']);
}



function template_breadcrumb($variables) {
  $breadcrumb = $variables['breadcrumb'];

  if (!empty($breadcrumb)) {
    // Provide a navigational heading to give context for breadcrumb links to
    // screen-reader users. Make the heading invisible with .element-invisible.
    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';

    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
    return $output;
  }
}

    function template_node_submitted(&$variables){
      return t('By !username on @datetime', array(
          '!username' => theme('username', $variables['node']),
          '@datetime' => format_date($variable['node']->created),
      ));
    }




    function template_preprocess_page(&$variables){
      $search_box = drupal_render(drupal_get_form('search_form'));
       `enter code here`$variables['search_box'] = $search_box;
      }

请帮我找出错误。由于我对 Drupal 很陌生,我无法调试它。

4

0 回答 0