• Resolved coreyalderin

    (@coreyalderin)


    My search function does not work properly anymore. I am not sure when it stopped but I think it was with the most recent update.

    I can type into the search field and hit enter. It send me to the search results page but shows all records.

    Here is my page where you can see it happen: www(.)christianquotes(.)info/search-for-a-quote/

    Any ideas what could be causing this?

    Thanks

    https://www.ads-software.com/plugins/participants-database/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Hard to say what’s going on there. The POST request is going out with all the right values, but it comes back empty. You’ll notice the search term is not present in the search field. Also if you submit a search with no search term, there is no error. I’d suggest turning WP_DBUG on and see what shows up in the PHP error log.

    Thread Starter coreyalderin

    (@coreyalderin)

    Thanks for the reply.

    I turned on my debug on my test site and here is the error I get related to the plugin:

    Notice: Trying to get property of non-object in /home/texttruth/public_html/wp-content/plugins/participants-database/classes/PDb_Update_Notices.class.php on line 204

    Notice: Trying to get property of non-object in /home/texttruth/public_html/wp-content/plugins/participants-database/classes/PDb_Update_Notices.class.php on line 204

    Do you know what this means?

    Thanks

    Plugin Author xnau webdesign

    (@xnau)

    These are only syntax notices and could not be responsible for the issue you’re experiencing. These notices are addressed in the upcoming release.

    Try submitting your form and see what comes up in the log.

    Thread Starter coreyalderin

    (@coreyalderin)

    Here are the other 2 errors that appear. I did not notice the reference to this plugin the second one until now. Could either of these be the cause?

    Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21

    Warning: Cannot modify header information – headers already sent by (output started at /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php:21) in /home/texttruth/public_html/wp-content/plugins/participants-database/classes/WP_Session.class.php on line 123

    Thanks for the help

    Thread Starter coreyalderin

    (@coreyalderin)

    When you say “what comes up in the log”, are you talking about the errors that appear at the top of the page? I have an error_log file in the wp_content folder but it looks like nothing has been entered in there for a long time

    Plugin Author xnau webdesign

    (@xnau)

    Well the first error is because there are two places where someone has attempted to define the global constant “WP_DEBUG” such constants can only be defined once. That is usually done in the wp-config.php file.

    The second is the kind of thing that happens when you have errors dumped to the screen. You should turn PHP “display_errors” (or WP_DEBUG_DISPLAY) off to avoid this, because things won’t operate normally when the correct headers cannot be sent.

    Check this page for details: https://codex.www.ads-software.com/Debugging_in_WordPress

    Submitting a form can generate errors to the error log. The error log your’e referring to is a log that is produced by WordPress when WP_DEBUG_LOG is enabled. That may not catch all PHP errors, so I would recommend setting up a regular PHP error log and seeing if any errors come in there when the form is submitted.

    Another thing: sometimes it is helpful to selectively disable plugins that affect the page dynamics to find out if there is interference from another plugin.

    Thread Starter coreyalderin

    (@coreyalderin)

    Thanks for the continued help.

    I turned display errors off, and deactivated all plugins except this one and now a PHP error log plugin.

    Here is a dump of the last 30 lines since I was not sure exactly what was all relevant:

    [08-Jul-2015 21:46:45 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:46:45 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p WHERE p.quote LIKE “%test%” ORDER BY p.rand DESC
    [08-Jul-2015 21:30:07 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:30:07 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:29:34 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:29:26 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:29:26 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:27:00 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:27:00 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p WHERE p.quote LIKE “%what%” ORDER BY p.rand DESC
    [08-Jul-2015 21:26:54 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:26:48 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:26:28 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:26:28 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p WHERE p.quote LIKE “%test%” ORDER BY p.rand DESC
    [08-Jul-2015 21:25:36 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:36 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:36 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:36 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:36 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:32 UTC] PHP Notice: Undefined index: old_sdk in /home/texttruth/public_html/wp-content/plugins/facebook-comments-plugin/class-frontend.php on line 39
    [08-Jul-2015 21:25:32 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote FROM wp_participants_database p ORDER BY p.rand DESC
    [08-Jul-2015 21:25:31 UTC] PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p WHERE p.quote LIKE “%test%” ORDER BY p.rand DESC
    [08-Jul-2015 21:25:29 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:28 UTC] PHP Notice: Constant WP_DEBUG already defined in /home/texttruth/public_html/wp-content/plugins/attributron-2000/a2k.php on line 21
    [08-Jul-2015 21:25:24 UTC] PHP Notice: Undefined index: old_sdk in /home/texttruth/public_html/wp-content/plugins/facebook-comments-plugin/class-frontend.php on line 39

    Thread Starter coreyalderin

    (@coreyalderin)

    Thanks for the continued help. I turned off displaying the errors in the header and I disabled all plugins except for this one and a PHP error log plugin.

    Here are the last 30 lines of errors since I am not sure what is relevant:

    Thread Starter coreyalderin

    (@coreyalderin)

    PDb_List::_setup_iteration list query: SELECT p.id, p.quote FROM wp_participants_database p ORDER BY p.rand DESC

    Thread Starter coreyalderin

    (@coreyalderin)

    PDb_List::_setup_iteration list query: SELECT p.id, p.quote, p.author, p.topic, p.rand FROM wp_participants_database p WHERE p.quote LIKE “%test%” ORDER BY p.rand DESC

    For some reason this is not allowing me to copy and past all 30 lines of code so I just did the first 2 lines of code which appear to be the 2 errors that are happening when I do a search

    Plugin Author xnau webdesign

    (@xnau)

    OK, I figured it out. Do you have another Participants Database shortcode on that page somewhere? Anyway, what’s going on is the “target_instance” of the form is assuming it is the first Participants Database shortcode on the page…but it’s not, it’s the second. So, what you need to do is add the target instance value to the shortcode:

    [pdb_list target_instance=2]

    plus whatever other attributes you want to use.

    This is because the plugin needed to be aware of multiple instances of the plugin on a page so the interactions could be coordinated.

    Thread Starter coreyalderin

    (@coreyalderin)

    Great, thanks. I use the search shortcode in PHP (like this <?php echo do_shortcode( ‘[pdb_search template=”cq” target_page=”search-for-a-quote”]’ ); ?> ) on the header so it shows up on all pages. There is then an identical second search shortcode (with PHP as well) on the homepage. So on the homepage there are 2 search shortcodes

    Then on the pages that display the lists I am using the [pdb_list ….] shortcode so on those pages there is a [pdb_list ….] and then a search shortcode (from the header) on the same page.

    Do I need to put [pdb_list target_instance=2] on the list shortcode in that case? I have lots of individual pages created with the [pdb_list …] shortcode and only 2 instances of the search shortcode so can I change just the search shortcode? That would save me so much time.

    Thanks again

    Plugin Author xnau webdesign

    (@xnau)

    You have to change the list shortcode because the search form that is generated by that shortcode needs to know which shortcode to show the results in. I know that is a little inconvenient, but your approach is pretty unconventional, so some extra effort is called for.

    Thread Starter coreyalderin

    (@coreyalderin)

    OK. Not what I was hoping but it is what it is. I went in and changed it but it is still doing the same thing.

    I changed this: [pdb_list template=”cq” search=”true” fields=’quote’]

    to this: [pdb_list target_instance=2 template=”cq” search=”true” fields=’quote’]

    Is that the way I should have doe it? Sorry for all the back and forth required.

    Plugin Author xnau webdesign

    (@xnau)

    That’s correct, but on the quote search page, the form is still targeting instance 1. Take a look at the HTML of the form, in the hidden fields at the top: you’re looking at the field named “target_instance” That needs to be 2 in order for the search results to show. Are you using some kind of page caching? If so, try clearing the cache.

    I don’t mind getting into this, it’s helping me make sure there isn’t some kind of bug.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Search not working now’ is closed to new replies.