Modifiers only work if the collection parameter is set
Is this the expected behavior for a keyword search?
I have a keyword search for all the collections and I was expecting the modifiers to work without having to list all of the collections in the results tag. However that isn't the case. If the param isn't set then the collections object in lsf.keywords.php is set to an empty array which then doesn't allow for the modifiers code to be executed on line 198.
Replies
Low 26 Dec 2013 15:57
Ah, not really expected behaviour. But you could work around the problem for now by setting the collection to something like collection="not foo" where "foo" is a non-existent collection.
Christian 26 Dec 2013 16:07
Not too big of an issue, but I was confused for a bit.
Didn't think to use "not" though, works great. Thanks!
Gary Reckard 2 Apr 2015 01:15
I ran into this problem today on 4.1.1. I did not specify a collection, since the docs said "Will use all collections if not specified and keywords are given.". I was baffled when the modifiers seemed to have no effect at all, until I tried setting a collection. I eventually got around it by listing all collections, though I suppose using the 'not foo' would be better.
Could this be fixed by filling the _collections array with all collections, if no collections are specified, in lsf.keywords.php?
Low 2 Apr 2015 07:06
Hmm, thought I fixed this. Maybe it got undone with the v4 refactoring. Anyway, to fix, open up lsf.keywords.php and add this to line #311, moving the existing code down: