Closed (fixed)
Project:
Rich Snippets
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
21 Feb 2013 at 19:47 UTC
Updated:
17 May 2013 at 22:50 UTC
Jump to comment: Most recent file
The rich_snippets_default_preprocessor function assumes its getting passed node entity data, which isn't always the case.
There is probably a better way to do this, but for now, I've added a return if the node object isn't present inside the resultset.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1923904-3.patch | 2.24 KB | nick_vh |
| #1 | 1923904-search-nodes-only.patch | 731 bytes | japerry |
Comments
Comment #1
japerryBelow is a patch to check for the node object before printing node specific variables.
Comment #2
cpliakas commentedGood catch. Thanks for posting a patch, and I definitely want to explore ways to be non-node friendly. Would love to hear some ideas on how to proceed.
Chris
Comment #3
nick_vhI don't think we should block on only node centric code. For example : http://nickveenhof.be/search/site/thesis
The first result is a file, and it still can benefit from some of the rich snippets markup if support is added to it.
Attached is a patch I'm using
Comment #4
cpliakas commentedI like this approach.
What happens when the apachesolr_get_index_key_map() returns FALSE? I want to make sure that use case is handled gracefully.
Thanks for the contribution,
Chris
Comment #5
nick_vhsince you have isset() in all the code that relies on the output of apachesolr_get_index_key_map, it is safe to return false.
Comment #6
_randy commentedNick_vh's approach and patch looks good. Our use case with commons suffers from issues with Rich Snippets and Tika file search results. The patch provided by Nich_vh eliminates the assumption of node based result sets.
Comment #7
cpliakas commentedExcellent. Thanks for testing! Marking as RTBC.
Comment #8
cpliakas commentedCommitted at http://drupalcode.org/project/rich_snippets.git/commit/fad5697.