Closed (fixed)
Project:
Drupal.org customizations
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
17 Oct 2010 at 22:46 UTC
Updated:
23 May 2014 at 18:23 UTC
Jump to comment: Most recent
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
Comment #1
drummActually we should do
global $theme
if ($theme === 'bluecheese') {
show refinements. We do want those on subsites, if they have the new theme.
}
Comment #2
nnewton commentedRe-rolled for this change:
Comment #3
gábor hojtsyIndeed. 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?
Comment #4
drummThe 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.
Comment #5
nnewton commentedThis has been committed.