Public Ticket #2220961
Search Error


  • jasoncrundwell started the conversation

    It was brought to my attention that our search tool no longer works.  We receive a fatal error.

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function wp_parse_str(), 1 passed in /home/mstpeters/public_html/wp-content/themes/polytechnic/search.php on line 10 and exactly 2 expected in /home/mstpeters/public_html/wp-includes/formatting.php:4852 Stack trace: #0 /home/mstpeters/public_html/wp-content/themes/polytechnic/search.php(10): wp_parse_str('s=crundwell') #1 /home/mstpeters/public_html/wp-includes/template-loader.php(98): include('/home/mstpeters...') #2 /home/mstpeters/public_html/wp-blog-header.php(19): require_once('/home/mstpeters...') #3 /home/mstpeters/public_html/index.php(17): require('/home/mstpeters...') #4 {main} thrown in /home/mstpeters/public_html/wp-includes/formatting.php on line 4852

    I reviewed this ticket, but it didn't provide a solution other than the customer figured it out.   We did upgrade our server's PHP earlier this summer.  I don't know when the error manifested itself.  

    I did strip out all our plugins and do a test and we still see the error.  

  •  123
    Charles replied

    Hi jasoncrundwell, 

    Thanks for reporting this and for providing those details. The search is working on my stock installs, but I have some ideas that you can try. Beyond that, I'll need to be able to replicate this on my end to troubleshoot further.

    = =

    1. Run through the standard troubleshooting steps - https://themeisland.ticksy.com/article/1954/

    1.a. When checking your source code, I am seeing an unfamiliar structure, which I suspect is from a caching plugin/functionality that you have on your install. You'll want to remove that to limit possible variables here.

    1.b. Also, I don't see style.css so if you are running a child theme, please try activating the parent theme, and deactivating 3rd party plugins/code as mentioned in those steps provided. 

    1.c. From there, check the parent theme version, and update if needed. Here is the change log for polytechnic - https://themeforest.net/item/polytechnic-powerful-education-courses-events/9222581#item-description__change-log

    From there, check the PHP version that you are running (there are a couple plugins out there that can help with this - https://wordpress.org/plugins/tags/phpinfo/)

    Let me know how it goes and if you need any help with these items. 


  •  123
    Charles replied

    Did some additional digging on this, and my have a lead for you. Please standby.

  •  123
    Charles replied

    I have an update, but will need you to validate if this works before I include it in a potential update. 

    If you have access to your FTP directory, can you try the following: 

    1. Navigate to wp-content/themes/polytechnic/search.php

    2. Comment out this line (should be about line 10) - from this: 

    $search_query = wp_parse_str( $query_string );

    to this: 

    // $search_query = wp_parse_str( $query_string );

    3. Save

    Let me know if that fixes the issue.


  • jasoncrundwell replied


    Sorry for the delay, school was out for the extended Thanksgiving holiday in the US.  That corrected the issue and we are seeing results now.   Thanks for your assistance!