Closed (fixed)
Project:
Fusion
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jan 2011 at 03:43 UTC
Updated:
12 Apr 2011 at 11:13 UTC
Jump to comment: Most recent file
Comments
Comment #1
realityloop commentedResolved by adding isset() as follows:
Before:
After:
Comment #2
syntax-2 commentedimho:
$vars['template_files'][] = 'search-result-' . $result['node']->type;
or
$vars['template_files'][] = 'search-result-' . $result['type'];
"$result['node']->type" is a system name of content type
"$result['type']" is a user name of content type
i prefer first one ;-)
Comment #3
coltraneWhat are the steps? I can't reproduce this, so it'd be helpful to know how you have your site configured and what you are searching for that results in this. Or, try the latest dev release and confirm if this is still an error.
Comment #4
syntax-2 commented@coltrane
latest dev version (April 4, 2011 - 00:09)
Notice: Undefined index: type in fusion_core_preprocess_search_result() (line 250 of /var/www/drupal-7.0/sites/all/themes/fusion/fusion_core/template.php).
acquia-marina theme's search box -> one item search result list -> click at node title link -> node page with Notice like above
only for not logged user, for administrator is ok (there is no notice)
Comment #5
coltraneThanks, that helps! I can duplicate now. It's on the first request after clicking through from the search result page, a refresh of the node doesn't show the error (since the dsm happened in the tpl it appeared upon following request).
Comment #6
coltraneIn Drupal 6
$vars['type']is the result type 'user' or 'node' (from http://api.drupal.org/api/drupal/modules--search--search-result.tpl.php/6) but in Drupal 7 that property doesn't exist (http://api.drupal.org/api/drupal/modules--search--search-result.tpl.php)We could instead add in the human-readable node type or make the node or user distinction based on if
$infois set, since it supposedly does not apply to user searches. Thoughts?Comment #7
aquariumtap commentedThanks everyone. Coltrane helped me reproduce this over IRC. Seems 'type' was renamed to 'module' in D7.
For documentation's sake: the functionality that was broken (and throwing the error) creates a template suggestion for different search result types.
Themers can style the Content and Users search result tabs differently by duplicating search-results.tpl.php, then renaming the dup to either of these:
Comment #8
coltraneYep, good catch! Tested and it no longer shows the error.
Comment #9
aquariumtap commentedGreat. Patch committed to HEAD.