1 I'm very excited to try out ikiwiki, since it should fit my purposes extremely well, but I'm having trouble with the search plugin. I'm pretty sure that right after I installed ikiwiki and needed dependencies, the search plugin was working fine. However, now when I try to use search, I get "Exception: Unknown function `this'" error on a blank page. I'm not sure how I should go about debugging this issue - my server's (I use Lighttpd 1.4.22) error log has no mention of the exception and there's nothing in /var/log/syslog either.
3 What might be causing this exception and how I might go about debugging exceptions?
5 > Appears to be coming from your xapian omega cgi binary. If you
6 > run `strings /usr/lib/cgi-bin/omega/omega` you can see it has
7 > "Exception: " in it, and I have found some similar (but not identical)
8 > error messages from xapian in a web search.
10 > I donĀ“t know what to suggest, other than upgrade/downgrade/reinstall
11 > xapian-omega, and contacting the xapian developers for debugging.
12 > You could try rebuilding your wiki in case it is somehow
13 > caused by a problem with the xapian database. Failing everything, you
14 > could switch to [[google_search_plugin|plugins/google]]. --[[Joey]]
16 >> Thanks, Joey. With your help I was able to figure out what was wrong. It's a fun little bug (or feature): the title of my wiki had string `$this` in title and that's what was causing the omega binary to choke. My wiki's title was inserted without escaping into the query template used by omega. Omega treated `$this` in the title as a function name and threw an exception because no such function was defined. To avoid this behavior, I used an html entity in the title, so `$this` became `$this`. I don't think that the wiki title should be inserted into the template without escaping - it can produce an error that's not trivial to debug. If users want to modify the html in the title, they should be editing respective templates, not typing html in the wiki title input. What do you think? --[[dkobozev]]
18 >>> Sounds like a bug in omega, and one that probably would affect other
19 >>> users of omega too. Ikiwiki could work around it by pre-escaping
20 >>> data before passing it to xapian. I have not quite managed to reproduce it though;
21 >>> tried setting a page title to '$this' and 'foo $this'.
22 >>> That's with version 1.0.18 of omega.
25 >>>> I tried it with both omega 1.0.13 and omega 1.0.18 and the issue is present in both. If I view the contents of {$srcdir}/.ikiwiki/xapian/templates/query, I can see that the wiki title is inserted verbatim and there are calls to `$setmap`, `$set` and `$def` etc in the template. --[[dkobozev]]