i edit function search_objects_hook in search_hooks.php
i edit
$fields = array('title', 'description');
to
$fields = array('title');
because i dont want search the description
but it return Fatal Error
i discovered the reason is in function search_get_where_sql in start.php
if
$where = "(MATCH ($fields_str) AGAINST ('$query' $options))";
changed to
$where = "(MATCH (title,description) AGAINST ('$query' $options))";
it works fine
but if it changed to
$where = "(MATCH (title) AGAINST ('$query' $options))";
it return Fatal Error
why ?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
- iionly@iionly
iionly - 0 likes
- Avicena AlGhiffar Alsharaawy@AVicenaGhifa
Avicena AlGhiffar Alsharaawy - 0 likes
You must log in to post replies.The change you made in start.php in search_get_where_sql is nonsense. If you get a fatal error due to the change in search_hooks.php the change in start.php doesn't fix the problem for sure (it might only seem to do so as you don't get a fatal error anymore but only because the search parameters are modified in a way that you wouldn't get any results anyway or at least not the correct results).
Are you sure that it doesn't work with
in seach_hooks.php? I just tried it myself and it works fine. If you still get an error with only this change you might want to look into the server log to find out what the problem is (maybe you left the comma after 'title' in the code?).
I have to correct myself. There's a fatal error indeed with only changing the $fields line in search_hooks.php.
Try it with also altering the following line:
Thanks , it works !!!!