Currently the Refine Search radio buttons appear under the search box on all sites with drupalorg_crosssite enabled. This doesn't really fit with the theme on groups and is likely not what we want anyway. Below is a small patch to disable this on the subsites, the same way we are doing the top nav:


--- drupalorg_crosssite.module	15 Oct 2010 23:47:23 -0000	1.121
+++ drupalorg_crosssite.module	17 Oct 2010 22:43:06 -0000
@@ -766,32 +766,33 @@
  * Implementation of hook_form_search_theme_form_alter().
  */
 function drupalorg_crosssite_form_search_theme_form_alter(&$form, $form_state) {
-
-  // If we already ran a query, remember those values in the header search bar.
-  $meta_type = '';
-  if (drupalorg_crosssite_apachesolr_has_searched() && $query = apachesolr_current_query()) {
-    // If a meta_type was specified to refine the search, save that.
-    $filter = $query->get_filters('ss_meta_type');
-    if (!empty($filter)) {
-      $meta_type = $filter[0]['#value'];
+  if (variable_get('drupalorg_crosssite_redesign', FALSE)) {
+    // If we already ran a query, remember those values in the header search bar.
+    $meta_type = '';
+    if (drupalorg_crosssite_apachesolr_has_searched() && $query = apachesolr_current_query()) {
+      // If a meta_type was specified to refine the search, save that.
+      $filter = $query->get_filters('ss_meta_type');
+      if (!empty($filter)) {
+        $meta_type = $filter[0]['#value'];
+      }
+      // Default the search text to the value of the queried text.
+      $form['search_theme_form']['#default_value'] = $query->get_keys();
     }
-    // Default the search text to the value of the queried text.
-    $form['search_theme_form']['#default_value'] = $query->get_keys();
-  }
 
-  $form['search_theme_form']['#title'] = t('Search Drupal.org');
-  $form['advanced'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Refine your search'),
-    '#collapsible' => !drupal_is_front_page(),
-    '#collapsed' => !drupal_is_front_page(),
-  );
-  $form['advanced']['meta_type'] = array(
-    '#type' => 'radios',
-    '#options' => drupalorg_crosssite_meta_types(),
-    '#default_value' => $meta_type,
-  );
-  $form['#submit'][] = 'drupalorg_crosssite_search_theme_form_submit';
+    $form['search_theme_form']['#title'] = t('Search Drupal.org');
+    $form['advanced'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Refine your search'),
+      '#collapsible' => !drupal_is_front_page(),
+      '#collapsed' => !drupal_is_front_page(),
+    );
+    $form['advanced']['meta_type'] = array(
+      '#type' => 'radios',
+      '#options' => drupalorg_crosssite_meta_types(),
+      '#default_value' => $meta_type,
+    );
+    $form['#submit'][] = 'drupalorg_crosssite_search_theme_form_submit';
+  }
 }
 

Comments

drumm’s picture

Actually we should do

global $theme
if ($theme === 'bluecheese') {
show refinements. We do want those on subsites, if they have the new theme.
}

nnewton’s picture

Re-rolled for this change:

--- drupalorg_crosssite.module	15 Oct 2010 23:47:23 -0000	1.121
+++ drupalorg_crosssite.module	18 Oct 2010 17:03:32 -0000
@@ -766,32 +766,34 @@
  * Implementation of hook_form_search_theme_form_alter().
  */
 function drupalorg_crosssite_form_search_theme_form_alter(&$form, $form_state) {
-
-  // If we already ran a query, remember those values in the header search bar.
-  $meta_type = '';
-  if (drupalorg_crosssite_apachesolr_has_searched() && $query = apachesolr_current_query()) {
-    // If a meta_type was specified to refine the search, save that.
-    $filter = $query->get_filters('ss_meta_type');
-    if (!empty($filter)) {
-      $meta_type = $filter[0]['#value'];
+  global $theme;
+  if ($theme === 'bluecheese') {
+    // If we already ran a query, remember those values in the header search bar.
+    $meta_type = '';
+    if (drupalorg_crosssite_apachesolr_has_searched() && $query = apachesolr_current_query()) {
+      // If a meta_type was specified to refine the search, save that.
+      $filter = $query->get_filters('ss_meta_type');
+      if (!empty($filter)) {
+        $meta_type = $filter[0]['#value'];
+      }
+      // Default the search text to the value of the queried text.
+      $form['search_theme_form']['#default_value'] = $query->get_keys();
     }
-    // Default the search text to the value of the queried text.
-    $form['search_theme_form']['#default_value'] = $query->get_keys();
-  }
 
-  $form['search_theme_form']['#title'] = t('Search Drupal.org');
-  $form['advanced'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Refine your search'),
-    '#collapsible' => !drupal_is_front_page(),
-    '#collapsed' => !drupal_is_front_page(),
-  );
-  $form['advanced']['meta_type'] = array(
-    '#type' => 'radios',
-    '#options' => drupalorg_crosssite_meta_types(),
-    '#default_value' => $meta_type,
-  );
-  $form['#submit'][] = 'drupalorg_crosssite_search_theme_form_submit';
+    $form['search_theme_form']['#title'] = t('Search Drupal.org');
+    $form['advanced'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Refine your search'),
+      '#collapsible' => !drupal_is_front_page(),
+      '#collapsed' => !drupal_is_front_page(),
+    );
+    $form['advanced']['meta_type'] = array(
+      '#type' => 'radios',
+      '#options' => drupalorg_crosssite_meta_types(),
+      '#default_value' => $meta_type,
+    );
+    $form['#submit'][] = 'drupalorg_crosssite_search_theme_form_submit';
+  }
 }
gábor hojtsy’s picture

Indeed. Also, for the same cross-site needs, it would be good to code the project specific parts in a way that would not require project modules to be around. At least make sure it never runs to the places where it would use project module. On a cursory look, it does require it in some cases, not just optionally. If it is truly just optional, why not remove the requirement from the .info too?

drumm’s picture

The search, along with everything else in the header (except for the admin-only admin link), should act the exact same across all sites. (Unless the theme is lagging.) Same meta type options, same defaults, same site to return the results.

nnewton’s picture

Status: Needs review » Fixed

This has been committed.

Status: Fixed » Closed (fixed)
Issue tags: -drupal.org redesign

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 1dd7dd5 on 6.x-3.x, 7.x-3.x-dev by nnewton:
    #944388 - by nnewton: Have subsites skip display of the refine your...