Send docs to theme subroutine instead of links

hurleyit - February 3, 2009 - 20:04
Project:Apache Solr Search Integration
Version:6.x-1.x-dev
Component:More Like This
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:MLT
Description

It would be great if the theme function got more information than an array of links. For me, I want to import some of the other node information. This patch passes $r['docs'] to the theme function instead of $links. I know that could be an issue with people who already created a custom them expecting links and if anyone has any suggestions on how to handle that, I would appreciate it.

AttachmentSize
apachesolr_mlt.module.patch1.35 KB

#1

pwolanin - February 4, 2009 - 00:25

A 6.x patch would be appreciated, since we are focusing active development there.

#2

hurleyit - February 4, 2009 - 00:46

I will try to do one, the issue is the site I'm using this on is Drupal 5 and I don't have a Drupal 6 site using apachesolr yet.

#3

hurleyit - February 4, 2009 - 17:36

Ok, I think I have a patch for 6 that will work, but I don't have a drupal 6 site that I can use to test it on where I can get matching documents. Should I create a new bug report for that patch and is there a way I could hook up a drupal 6 test site up to the beta of acquia's hosted solr project to test fully?

#4

janusman - February 4, 2009 - 18:12

Please post the patch so someone (me?) can look into it =)

If you have any ideas about other theming functions, please post =)

#5

hurleyit - February 4, 2009 - 19:02
Version:5.x-1.0-alpha5» 6.x-1.x-dev

Here is the one against the 6-dev version. Like I mentioned, I haven't been able to test fully, but if there are any issues, I will try to fix them.

AttachmentSize
apachesolr_mlt.module.patch 1.12 KB

#6

pwolanin - February 5, 2009 - 22:52

looks ok, though I'd prbably code:

count($r) > 0

as
!empty($r)

#7

davidseth - February 24, 2009 - 02:50

This patch works great! Just what I needed, more powerful MLT blocks so I can do something more than just display a list. Please commit :)

Thanks.

#8

davidseth - February 24, 2009 - 03:10
Status:needs review» postponed (maintainer needs more info)

#9

gregeise - March 24, 2009 - 20:32
Status:postponed (maintainer needs more info)» needs work

Tested patch. It works with beta 5 in that the code is valid, but of course will deliver some errors with the current MLT block, namely:

recoverable fatal error: Object of class Apache_Solr_Document could not be converted to string in /var/www/html/mysite/includes/theme.inc on line 1490.

...which is to be expected.

I think this is the way to go. I know I need that NID to get my pictures and item pricing to appear without having to jump through hoops.

#10

pwolanin - March 25, 2009 - 00:43
Status:needs work» needs review

Looks basically fine - please try to roll patches from the root of the project. Also, use the issue# in the patch file name for bonus points.

The patch fails, looks like there is a conflicting commit. Here's a new version to test.

AttachmentSize
theme-mlt-docs-368688-10.patch 3.13 KB

#11

pwolanin - March 30, 2009 - 23:14

Anyone had a chance to test this?

#12

gregeise - March 31, 2009 - 02:53

Not yet, but I will tomorrow afternoon.

#13

gregeise - March 31, 2009 - 15:27
Status:needs review» reviewed & tested by the community

Tested patch, works great. This is exactly what we needed.

I know that could be an issue with people who already created a custom them expecting links and if anyone has any suggestions on how to handle that, I would appreciate it.

This is a more flexible solution IMO.

#14

pwolanin - March 31, 2009 - 16:07
Status:reviewed & tested by the community» fixed

looks ok, but will need work for multi-site.

committed to 6.x

#15

poka_dan - April 2, 2009 - 17:52

Good stuff. I was just about to request this feature/improvement..
Kudos to you guys..

#16

System Message - April 16, 2009 - 18:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.