Jump to:

23367 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Built in search functionality bug - use of word 'as'

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 114 Views
  • HARVS1789UK
    Avatar
    Community Member
    19 Posts

    Built in search functionality bug - use of word 'as' Link to this post

    I have an issue with search in a SS 3.1 install, I wouldn't have thought an issue like this would exist in the core code and that it must be affected by something I have done however, other than some minor overloading of the SearchFrom() and getResults() methods on my Page class (neither of which effect the query building logic at all) it is a total stock usage of the search functionality.

    If I search for "[some word] as [some word]" (i.e 'cat as dog' or 'foo as bar') I get a fatal error (see the first attached image). Also, far less important, if I do the same in dev mode I also get a deprecated method notice (see the second attached image).

    I am fairly certain something weird is going on with the use of the word 'as' and SS's query building logic is mistaking it for part of an SQL statement e.g. `fieldname`AS 'labelname' I think this because of this part of the error message:

    "AGAINST ('foo AS "bar')", NULL"

    Notice that my 'as' word has been capitalised and is then followed by a single space and opening double quotes (as if it is about to wrap my label in quotes)

    Is this a bug?

    You may think 'who cares, hardly anyone will be searching for [someword] as [someword]... but I am having this issue on a live, customer facing website for a telecoms company... so the search "pay as you go" happens on a daily basis!

    Any help greatly appreciated.

    Kind regards,

    HARVS1789UK

  • camfindlay
    Avatar
    Forum Moderator
    146 Posts

    Re: Built in search functionality bug - use of word 'as' Link to this post

    This to me looks like a bug and I have been able to replicate on a fresh copy of 3.1.5.

    Would be worth raising a bug over at https://github.com/silverstripe/silverstripe-framework/issues.

  • HARVS1789UK
    Avatar
    Community Member
    19 Posts

    Re: Built in search functionality bug - use of word 'as' Link to this post

    Thanks for clarifying this is still an issue in the core code of SS 3.1 @camfindlay

    I have raised a bug as suggested - https://github.com/silverstripe/silverstripe-framework/issues/3212

    Lets hope someone is able to provide a fix

    114 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.