In the past I've always been able to override the theme form using the method mentioned http://drupal.org/node/154137.

function YOURTHEME_form_alter(&$form, &$form_state, $form_id) {
    if ($form_id == 'search_block_form') {
        $form['search_block_form']['#title'] = t('Search');

However, this doesn't appear to be recognised in the template.php of my latest theme. It hasn't been an issue in the past - what is the best way to debug why the hook doesn't appear to be activated?

1 Answer 1

  • Clear cache.
  • Place some debugging code to see if the hook and then if statement is called.
  • Inspect the form variable, does it look correct?
  • No debugging output is there. I'm slightly at a loss. I've just moved the theme over to a fresh Drupal installation and the hooks aren't being picked up. The setup is identical between the two instances. Its very odd!
    – jvc26
    Commented Jan 26, 2012 at 22:02
  • On extra debugging, found the issue which was elsewhere in the file and preventing it being correctly processed.
    – jvc26
    Commented Feb 26, 2012 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.