Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search Results Not displaying for specific keywords
- This topic has 10 replies, 2 voices, and was last updated 11 years, 3 months ago by
Ernest Marcinko.
-
AuthorPosts
-
February 10, 2015 at 7:48 pm #3853
webmdt
ParticipantADMIN URL – http://fairfieldschools.org/wp/admin
DEBUG URL – http://fairfieldschools.org/district-v2/debug.logSearch term – parent
February 10, 2015 at 8:01 pm #3854Ernest Marcinko
KeymasterHi!
I can only see 1 fatal error repeating in the log
[code]PHP Fatal error: Call to undefined function get_schools_list() in /var/www/vhosts/fairfieldschools.org/district-v2/themes/FPS_District-v2/templates/partials/parents-our-schools-v2.php on line 15[/code]
It comes from the theme as you can see. Try to fix that issue in that file, it might fix the search issue as well if its related.
February 10, 2015 at 8:04 pm #3855webmdt
ParticipantI believe we’re looking at a different log. As I see many lines of bugs. I have fixed that error however and the issue still persists.
The one regarding the AJAX search is:
[10-Feb-2015 18:42:00 UTC] PHP Notice: Trying to get property of non-object in /var/www/vhosts/fairfieldschools.org/district-v2/plugins/ajax-search-pro/functions.php on line 114
February 10, 2015 at 8:07 pm #3856Ernest Marcinko
KeymasterThe log updates ever minute or so. That’s only a notice it does cannot issue a an error 500 on the server, fatal errors do that.
The error is still there, look at the timestamp:
[code]10-Feb-2015 19:05:18 UTC PHP Fatal error: Call to undefined function get_schools_list() in /var/www/vhosts/fairfieldschools.org/district-v2/themes/FPS_District-v2/templates/partials/parents-our-schools-v2.php on line 15[/code]February 10, 2015 at 9:05 pm #3860webmdt
ParticipantStrange, as I’m not seeing it in my logs now. I was calling a function publicly..but I guess it wanted to be called individually.
I will keep checking back, and make sure there are no Fatal Errors on the page. Once I have achieved that, I will retest the search feature and get back to you.
Thanks for the quick response.
February 10, 2015 at 10:21 pm #3862webmdt
ParticipantHello again.
I have dug through all of the WP-Errors, the only one remaining is in regards to your plugin on the functions file. Its referencing the instance where your grabbing the POST DATA:
[code]PHP Notice: Trying to get property of non-object in /var/www/vhosts/fairfieldschools.org/district-v2/plugins/ajax-search-pro/functions.php on line 114[/code]
[code]Line 109-119:
if (!function_exists("get_content_w")) {
function get_content_w($id)
{
$my_postid = $id;
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
return $content;
}
}
[/code]February 10, 2015 at 10:42 pm #3864Ernest Marcinko
KeymasterThanks!
It was a backup code in cases if the user selects custom field content, but the custom field is not accessible or doesn’t exist. I must have made forgot to re-factor the function. It should have look something like this:
[code]if (!function_exists("get_content_w")) {
function get_content_w($content)
{
$content = apply_filters(‘the_content’, $content);
$content = str_replace(‘]]>’, ‘]]>’, $content);
return $content;
}
}[/code]Thanks for going through it 😉
February 10, 2015 at 10:53 pm #3865webmdt
ParticipantHello Ernest,
Thanks, I’ve updated the functions file and will continue to monitor this.
Will this change be placed into your next version you deploy (so that I can still update) ?
Thanks
February 10, 2015 at 11:50 pm #3870Ernest Marcinko
KeymasterSure thing. This was intended to be changed in the current version.
February 11, 2015 at 10:21 pm #3897webmdt
ParticipantThe error has gone away, but has been replaced with another:
http://fairfieldschools.org/district-v2/debug.log
Check the first error that occurred on Feb 11 ([11-Feb-2015 00:16:12 UTC])
Something to do with:
[code]CASE WHEN dist_ajaxsearchpro_priorities.priority IS NULL
THEN 100
ELSE dist_ajaxsearchpro_priorities.priority
END AS priority,[/code]February 12, 2015 at 11:06 am #3900Ernest Marcinko
KeymasterThe error is not acutally causes by that part, it’s this:
WordPress database error Got error ‘trailing backslash (\)’
[code](lower(dist_posts.post_content) REGEXP ‘paraprofessional|contract\\’)[/code]It’s either someone tried to search for a phrase with backslashes or attempting an SQL injection. the “\\” string might have been something else before processing. I would say it was not on purpose, doesn’t look like a injection pattern.
Anyways, it’s harmless because the wp database layer escapes and double checks everything and returns an error after terminating the query like this if something is not right, consequently the search returns no results.
-
AuthorPosts
- You must be logged in to reply to this topic.