Hi everyone,
I'm using 6.2 for a site I'm working on. I noticed the that the search results always returned blank - not even a "Your search produced no results" message. After some troubleshooting, I found out that the results of the search were getting wiped when it called the theme_box routine (in /includes/theme.inc) - for some reason, it wasn't calling that function. I played around with it a lot, and I finally got it to work correctly if I changed a line in search.pages.inc from


$results = theme('box', t('Search results'), $results);

to this:


$results = theme_box(t('Search results'), $results);

Has anyone seen this before, where theme functions need to be called like normal PHP functions, instead of being called like a Drupal theme function? Or does anyone have any ideas on what I can do to pinpoint this issue? Any input would be greatly appreciated. Thanks!

Comments

zeta ζ’s picture

Do you have a function called phptemplate_box(...) or my-theme-name_box(...)? If you have, it will be called by

  $results = theme('box', t('Search results'), $results);

___________________
It’s in the detaιls…

demonstration portfolio

pamelad’s picture

I did a site-wide search, and didn't find any function like that.

zeta ζ’s picture

If you expect me to think of another possibility, it would be helpful to tell me exactly what you searched for, so I know what you have eliminated.

I have no idea about you or your level of technical ability, so I am left wondering how thoroughly you have searched. I would suggest searching for '_box(' : This should find at least one function, possibly more…
___________________
It’s in the detaιls…

demonstration portfolio

pamelad’s picture

Sorry, you're right, I should have been more specific. I searched my entire directory for "_box(", and didn't find anything useful. It found a couple hits in the comment module (which is disabled in my site), the search module, and the function definition in theme.inc.

The search module does have a method called search_box, but that's the one that returns the search form.

zeta ζ’s picture

It was the ‘not finding anything’ that raised my doubts: It is easy to make a search too specific.

Either the theme registry needs to be cleared http://drupal.org/node/173880#theme-registry, or there is a definition (in hook_theme()?) that points incorrectly. Maybe a template that doesn’t exist?

Maybe you could try the devel module, that will tell you exactly which part of the themeing system is responsible for outputting the search-box.
___________________
It’s in the detaιls…

demonstration portfolio

pamelad’s picture

Hi,
Thanks for your help on this!

It turned out that there was a file overwriting it. My theme has a file called box.tpl.php. Somehow during the course of development, the contents of the file were deleted, so the file was completely empty. I reverted it back to its original form, and all is working well.