0

It is Drupal 7.

This is kind of strange behaviour of the website.

This is my website http://www.protecdental.com. If you visit this website, you will see the right-hand top search field. Please see the screenshot https://snag.gy/LfCDxs.jpg

If you type any junk keyword (That means the site will definitely throw 0 results) for example "werewe" then you will see the proper search result page with no result.

But if you type a keyword related to the website's content for example "dental" or "contact" or any related meaning full keyword then you will see the broken page with no content at all.

Not too sure the issues is: it seems like if there is a search result data, then it is somehow breaking the page:

I didn't find any error log for it even when I tried watchdog.

  • I cleared the cache
  • I re-indexed the search
  • I manually ran the cron

But no luck. Can anyone please help to at least narrow down the cause of this issue.

My default search result template:

<?php if ($search_results): ?>
    <h2><?php print t('Search results');?></h2>
    <ol class="search-results <?php print $module; ?>-results">
        <?php print $search_results; ?>
    </ol>
    <?php print $pager; ?>
<?php else : ?>
    <h2><?php print t('Your search yielded no results');?></h2>
    <?php print search_help('search#noresults', drupal_help_arg()); ?>
<?php endif; ?>
8
  • 1
    Put this in your settings.php file and see if you can get something useful. $conf['theme_debug'] = TRUE;
    – cchen
    Commented Oct 15, 2018 at 16:30
  • @cchen thank you for your quick response. I uncommented it in my settings.php file but didn't get any error message
    – mak
    Commented Oct 15, 2018 at 17:53
  • 1
    You are welcome. Do you have a custom template for the search result page? If so I'd double check the php syntax in the template.
    – cchen
    Commented Oct 15, 2018 at 18:04
  • 1
    You can check it in two ways. 1 use inspect element with 'theme_debug' on, and you should be able to see the active template's name and location of the search results section. 2. go to your custom theme's directory and look for something like search-results.tpl.php
    – cchen
    Commented Oct 15, 2018 at 19:00
  • 1
    Let us continue this discussion in chat.
    – cchen
    Commented Oct 16, 2018 at 0:12

1 Answer 1

0

No problem, yeah when you see an error page like that, most of time the issue is in one of the template files.

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.