Freelinking Does not Work with Views Backlinks

GregoryHeller - May 8, 2009 - 20:36
Project:freelinking
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:fixed
Description

See the issue that started here: http://drupal.org/node/452828

The backlinks view shows other nodes that link to the current node. It works off of the drupal search index and looks for links formetted like <a href=

Merlinofchaos suggests:

I think that would require freelinking (or maybe something on behalf of freelinking) implement hook_search to translate freelinks so that search gets the right information. Actually it's probably nodeapi $op = 'search'. Once search has the right information, Views can take advantage of it.

#1

Grayside - June 17, 2009 - 04:58

I believe Merlin meant nodeapi $op = 'update index', as I don't see a 'search' op in the nodeapi documentation.

#2

Grayside - June 17, 2009 - 06:05
Assigned to:Anonymous» Grayside

Okay, this patch seems to provide the needed functionality.

For every node being indexed for search, the node input format is checked. If that format includes the freelinking filter, it processes the node's body through the freelinking filter. The results of that processing are then extracted and added to the search index.

There is a minor problem with this approach- because only the freelinking filter is applied to the text, any other filters in the node's input format are ignored.

AttachmentSize
freelinking_indexable.patch 875 bytes

#3

Grayside - June 17, 2009 - 06:19
Status:active» needs review

Forgot this. Sorry for the triple post.

#4

douggreen - July 14, 2009 - 14:14

This had the right idea, but wasn't matching the filter properly and needed to replace the path alias with the node/nid. See attached patch.

AttachmentSize
452828.patch 1.19 KB

#5

GregoryHeller - July 17, 2009 - 00:53

I've tested @douggreen's patch 452828 on my client's site and it appears to be working.

#6

GregoryHeller - July 27, 2009 - 21:55

upon further testing i think the patch has only solved the problem when CamelCase freelinking is used but not when [[Double Bracket]] free linking is used.

#7

douggreen - August 26, 2009 - 21:40

I think that the issue is not with the [[Wiki Link]] style perse, but rather with having spaces in the title, that get html encoded. The updated patch should fix this.

AttachmentSize
452828.patch 1.59 KB

#8

eafarris - August 27, 2009 - 13:58
Version:6.x-3.0-alpha1» 6.x-1.8

This patch is not for version 3.

#9

eafarris - August 27, 2009 - 14:31

Note that version 3 works "out of the box," since it doesn't use the freelinking/ namespace, but generates search.module-friendly links directly to node/(nid).

#10

Grayside - August 27, 2009 - 21:56

My initial patch was for Freelinking 3, with some refinement it should be fine.

#11

GregoryHeller - August 31, 2009 - 20:54
Status:needs review» reviewed & tested by the community

@douggreen's patch in #7 works for me. I can now see backlinks info for [[Double Bracket]] style wiki pages with spaces in their names.

#12

Grayside - September 8, 2009 - 17:53
Assigned to:Grayside» Anonymous

#13

Grayside - November 24, 2009 - 05:59
Version:6.x-1.8» 6.x-1.x-dev
Status:reviewed & tested by the community» fixed

Please test the -dev version so the change can be released as part of Freelinking 1.9.

 
 

Drupal is a registered trademark of Dries Buytaert.