Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This should be a simple fix but I don't understand it.
It looks like the callback arguments don't match up. The theme function is not used at all and preventing me from converting search module into template files.
function search_box(&$form_state, $form_id) {
// Use search_keys instead of keys to avoid ID conflicts with the search block.
$form[$form_id .'_keys'] = array(
'#type' => 'textfield',
'#size' => 15,
'#default_value' => '',
'#attributes' => array('title' => t('Enter the terms you wish to search for.')),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
// Always go to the search page since the search form is not guaranteed to be
// on every page.
$form['#action'] = url('search/node');
$form['#submit'][] = 'search_box_form_submit';
$form['#validate'][] = 'search_box_form_validate';
$form['#theme'] = 'search_box_form';
return $form;
}
function search_forms() {
$forms['search_theme_form']= array(
'callback' => 'search_box',
'callback arguments' => array('search_theme_form'),
);
$forms['search_block_form']= array(
'callback' => 'search_box',
'callback arguments' => array('search_block_form'),
);
return $forms;
}
Can anyone spare a free moment and provide a patch? Or just tell me how to fix it and I'll roll it into the conversion. http://drupal.org/node/164032
thanks
Comment | File | Size | Author |
---|---|---|---|
#8 | search_theme.patch | 439 bytes | chx |
#5 | enable_themable_search_1.patch | 719 bytes | dvessel |
#4 | enable_themable_search.patch | 649 bytes | dvessel |
Comments
Comment #1
dvessel CreditAttribution: dvessel commentedMarking as critical.
Comment #2
dvessel CreditAttribution: dvessel commentedFound a workaround for now but there seems to be other problems with search.
Changed
$form['#theme'] = 'search_box_form';
from search_box() to the $form_id.$form['#validate'][] = 'search_box_form_validate';
doesn't exist and I get this error when viewing the search page:Comment #3
dvessel CreditAttribution: dvessel commentedThis is just so the template conversion can be reviewed.
http://drupal.org/node/164032
Comment #4
dvessel CreditAttribution: dvessel commentedAnd the patch..
Comment #5
dvessel CreditAttribution: dvessel commentedWell, I'm starting to belive this is actually the fix.
The callback arguments of search_forms() maps back to the $form_id.
Updated for latest head and marking for review.
Comment #6
dvessel CreditAttribution: dvessel commentedComment #7
Wim LeersWorks as advertised.
Comment #8
chx CreditAttribution: chx commentedThere is a simpler way to do the same...
Comment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #10
(not verified) CreditAttribution: commented