• Resolved espressivo

    (@espressivo)


    Ideas? It is only with this plugin activated.

    The error we get: PHP Fatal error: Uncaught TypeError: urlencode(): Argument #1 ($string) must be of type string, array given in /home/nginx/domains/(domain)/public/wp-includes/formatting.php:5683

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Honestly not sure what to suggest here because our plugin doesn’t make use of urlencode in our own code.

    Thread Starter espressivo

    (@espressivo)

    I am on staging and the only thing active is CPT and twenty twenty theme and search does not work.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Understood on that part, but I’m searching our plugins code base and not seeing any usage of urlencode. Not seeing the function inside of the TwentyTwentyFour theme either.

    Do you by any chance have some things in a mu-plugins file/folder that you maybe missed?

    Thread Starter espressivo

    (@espressivo)

    That was an error code given. If ya’ll do email support happy to email you login to staging. I just emptied the mu-plugins folder and tried again

    Error happened again. This time I got (so maybe grabbed the wrong error)

    [Mon Feb 05 18:04:29.533316 2024] [php:error] [pid 172] [client 49.12.33.216:58700] PHP Fatal error: Uncaught TypeError: urlencode(): Argument #1 ($string) must be of type string, array given in /var/www/html/site/public_html/wp-includes/formatting.php:5683\nStack trace:\n#0 /var/www/html/site/public_html/wp-includes/formatting.php(5683): urlencode(Array)\n#1 /var/www/html/site/public_html/wp-includes/class-wp-query.php(1179): wp_basename(Array)\n#2 /var/www/html/site/public_html/wp-includes/class-wp-query.php(2244): WP_Query->parse_tax_query(Array)\n#3 /var/www/html/site/public_html/wp-includes/class-wp-query.php(3824): WP_Query->get_posts()\n#4 /var/www/html/site/public_html/wp-includes/class-wp.php(696): WP_Query->query(Array)\n#5 /var/www/html/site/public_html/wp-includes/class-wp.php(816): WP->query_posts()\n#6 /var/www/html/site/public_html/wp-includes/functions.php(1336): WP->main(”)\n#7 /var/www/html/site/public_html/wp-blog-header.php(16): wp()\n#8 /var/www/html/site/public_html/index.php(6): require(‘/var/www/html/s…’)\n#9 {main}\n thrown in /var/www/html/site/public_html/wp-includes/formatting.php on line 5683, referer: https://(domain)

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Private correspondence can be initiated through https://pluginize.com/contact/

    That said, I looked up line number 5683 in wp-includes/formatting.php and it’s pointing to this function:

    function wp_basename( $path, $suffix = '' ) {
    	return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
    }

    I have also checked and we’re not using wp_basename() in CPTUI either, but apparently something in your install is, and it’s passing an array for the $path attribute.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Following up after some private correspondence, the issue is most likely coming from a registered taxonomy of “search_term” causing issues internally to WP core, when performing a search.

    Thread Starter espressivo

    (@espressivo)

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘CPT causes critical error with search’ is closed to new replies.