1

Drupal6 テーマを Drupal7 に変換しようとしていて、必要な変更を加えようとしました。しかし、エラー Fatal error: Unsupported operand types in /includes/theme.inc on line 1075 The line 1075 is $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