Search Results Not displaying for specific keywords

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search Results Not displaying for specific keywords

This topic contains 10 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 6 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #3853
    webmdt
    webmdt
    Participant
    #3854
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I can only see 1 fatal error repeating in the log

    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

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #3855
    webmdt
    webmdt
    Participant

    I 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

    #3856
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The 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:

    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
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #3860
    webmdt
    webmdt
    Participant

    Strange, 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.

    #3862
    webmdt
    webmdt
    Participant

    Hello 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:

    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
    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;
      }  
    }
    
    #3864
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thanks!

    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:

    if (!function_exists("get_content_w")) {  
      function get_content_w($content)
      {
          $content = apply_filters('the_content', $content);
          $content = str_replace(']]>', ']]>', $content);
          return $content;
      }  
    }

    Thanks for going through it 😉

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #3865
    webmdt
    webmdt
    Participant

    Hello 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

    #3870
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure thing. This was intended to be changed in the current version.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #3897
    webmdt
    webmdt
    Participant

    The 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:

    CASE WHEN dist_ajaxsearchpro_priorities.priority IS NULL
                       THEN 100
                       ELSE dist_ajaxsearchpro_priorities.priority
                END AS priority,
    #3900
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The error is not acutally causes by that part, it’s this:

    WordPress database error Got error ‘trailing backslash (\)’

    (lower(dist_posts.post_content) REGEXP 'paraprofessional|contract\\')

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.