I'm not sure exactly what is causing it, but whenever I turn the search box in the header on it displays for a short period and then I'll notice it's disappeared during one of my many page refreshes while I'm tweaking the subtheme. I have my subtheme set to rebuild the theme registry on every page request. That is, I have Zen set like this (the Zen options do not appear on my subtheme configuration page). It's possible I've set it up wrong though.

Comments

harrisben’s picture

Sorry, I meant to say that when I've noticed the search box is gone it's changed to disabled on my subtheme settings page and enabling it again brings it back, but only until it disappears once more. This occurs less frequently than every couple of minutes and more frequently than every day.

kdebaas’s picture

Could you verify if your subtheme is installed correctly according to the instructions? If that is the case, you might try flushing the Drupal cache at /admin/settings/performance, before enabling the search form.

If your subtheme is installed correctly, you should be able to enable the theme registry rebuilding on your subtheme settings page, as well as the wireframe option. So if these options aren't there, it might be a symptom of a problem related to your dissappearing search box.

harrisben’s picture

I followed the instructions where possible (some items no longer apply, such as copying zen.css). I've tried clearing the cache and the problem seems to persist.

Although I can't see the option on my subtheme configuration page to enable rebuilding the theme registry on every page load, it seems to be enabled as the message appears above my content.

kdebaas’s picture

Normally, you should be able to, for example, have theme registry rebuilding switched ON for your zen theme, and OFF for your subtheme, or vice versa. So those options should be there.

Why don't you post the contents of your subtheme's template.php and theme-settings.php here, so we can take a look?

okeedoak’s picture

Status: Closed (duplicate) » Active

Noticed the same weird problem.

okeedoak’s picture

Status: Active » Closed (duplicate)
harrisben’s picture

Status: Active » Closed (duplicate)

my template.php (Excluding the majority of commented out sections):

<?php
/**
 * Implementation of HOOK_theme().
 */
function cibus_theme(&$existing, $type, $theme, $path) {
  $hooks = zen_theme($existing, $type, $theme, $path);
  // Add your theme hooks like this:
  /*
  $hooks['hook_name_here'] = array( // Details go here );
  */
  // @TODO: Needs detailed comments. Patches welcome!
  return $hooks;
}

/**
 * Ubercart overrides.
 */

/**
 * Format a product's price.
 *
 * @param $price
 *   The amount to print.
 * @param $context
 *   Determines the label and the CSS class of the <div>.
 * @ingroup themeable
 */
function cibus_uc_product_price($price, $context, $options = array()) {
  if ($price != 0) {
	$output = '<div class="product-info '. implode(' ', (array)$context['class']) .'">';
    $output .= uc_price($price, $context, $options);
    $output .= '</div>';
  }

  return $output;
}

/**
 * Display a formatted list of products.
 *
 * @param $products
 *   An array of product nids.
 * @return
 *   A TAPIr table.
 * @ingroup themeable
 */
function cibus_uc_catalog_product_grid($products) {
  $product_table = '<div class="category-grid-products"><table>';
  $count = 0;
  $context = array(
    'location' => 'catalog-grid-product',
  );
  foreach ($products as $nid) {
    $product = node_load($nid);
    $context['subject'] = array('node' => $product);

    if ($count == 0) {
      $product_table .= "<tr>";
    }
    elseif ($count % variable_get('uc_catalog_grid_display_width', 3) == 0) {
      $product_table .= "</tr><tr>";
    }

    $titlelink = l($product->title, "node/$nid", array('html' => TRUE));
    if (module_exists('imagecache') && ($field = variable_get('uc_image_'. $product->type, '')) && isset($product->$field) && file_exists($product->{$field}[0]['filepath'])) {
      $imagelink = l(theme('imagecache', 'product_list', $product->{$field}[0]['filepath'], $product->title, $product->title), "node/$nid", array('html' => TRUE));
    }
    else {
      $imagelink = '';
    }

    $product_table .= '<td>';
    if (variable_get('uc_catalog_grid_display_title', TRUE)) {
      $product_table .= '<span class="catalog-grid-title">'. $titlelink .'</span>';
    }
    if (variable_get('uc_catalog_grid_display_model', TRUE)) {
      $product_table .= '<span class="catalog-grid-ref">'. $product->model .'</span>';
    }
    $product_table .= '<span class="catalog-grid-image">'. $imagelink .'</span>';
    if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
      if ($product->sell_price != 0) {
    	$product_table .= '<span class="catalog-grid-sell-price">'. uc_price($product->sell_price, $context) .'</span>';
	  }
    }
    if (variable_get('uc_catalog_grid_display_add_to_cart', TRUE)) {
      if (variable_get('uc_catalog_grid_display_attributes', TRUE)) {
        $product_table .= theme('uc_product_add_to_cart', $product);
      }
      else {
        $product_table .= drupal_get_form('uc_catalog_buy_it_now_form_'. $product->nid, $product);
      }
    }
    $product_table .= '</td>';

    $count++;
  }
  $product_table .= "</tr></table></div>";
  return $product_table;
}

/**
 * Format a product's images with imagecache and Thickbox.
 *
 * @ingroup themeable
 */
function cibus_uc_product_image($images, $teaser = 0, $page = 0) {
  static $rel_count = 0;

  // Get the current product image widget.
  $image_widget = uc_product_get_image_widget();
  $image_widget_func = $image_widget['callback'];

  $first = array_shift($images);

  $output = '<div class="product-image"><div class="main-product-image">';
  $output .= '<a href="'. imagecache_create_url('product_full', $first['filepath']) .'" title="'. $first['data']['title'] .'"';
  if ($image_widget) {
    $output .= $image_widget_func($rel_count);
  }
  $output .= '>';
  $output .= theme('imagecache', 'product', $first['filepath'], $first['data']['alt'], $first['data']['title']);
  $output .= '</a><br /><em>click for larger</em></div><div class="more-product-images">';
  foreach ($images as $thumbnail) {
    // Node preview adds extra values to $images that aren't files.
    if (!is_array($thumbnail) || empty($thumbnail['filepath'])) {
      continue;
    }
    $output .= '<a href="'. imagecache_create_url('product_full', $thumbnail['filepath']) .'" title="'. $thumbnail['data']['title'] .'"';
    if ($image_widget) {
      $output .= $image_widget_func($rel_count);
    }
    $output .= '>';
    $output .= theme('imagecache', 'product', $thumbnail['filepath'], $thumbnail['data']['alt'], $thumbnail['data']['title']);
    $output .= '</a><br /><em>click for larger</em>';
  }
  $output .= '</div></div>';
  $rel_count++;

  return $output;
}

My theme-settings.php (unmodified):

<?php
// $Id: theme-settings.php,v 1.7 2008/09/11 09:36:50 johnalbin Exp $

// Include the definition of zen_settings() and zen_theme_get_default_settings().
include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php';


/**
 * Implementation of THEMEHOOK_settings() function.
 *
 * @param $saved_settings
 *   An array of saved settings for this theme.
 * @return
 *   A form array.
 */
function STARTERKIT_settings($saved_settings) {

  // Get the default values from the .info file.
  $defaults = zen_theme_get_default_settings('STARTERKIT');

  // Merge the saved variables and their default values.
  $settings = array_merge($defaults, $saved_settings);

  /*
   * Create the form using Forms API: http://api.drupal.org/api/6
   */
  $form = array();
  /* -- Delete this line if you want to use this setting
  $form['STARTERKIT_example'] = array(
    '#type'          => 'checkbox',
    '#title'         => t('Use this sample setting'),
    '#default_value' => $settings['STARTERKIT_example'],
    '#description'   => t("This option doesn't do anything; it's just an example."),
  );
  // */

  // Add the base theme's settings.
  $form += zen_settings($saved_settings, $defaults);

  // Remove some of the base theme's settings.
  unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet.

  // Return the form
  return $form;
}

There's the problem! I don't recall the instructions saying I had to edit theme-settings.php too, but it's entirely possible I missed it.

kdebaas’s picture

Great! I suppose you now have the theme registry rebuilding options back on your subtheme. But, did this also fix the problem you had with the searchbox?

harrisben’s picture

I have the theme settings options on my subtheme, but the searchbox problem persists unfortunately.