[Better Search] Notice : Array to string conversion
-
Hi,
My search plugin stop working and display Notice:
Array to string conversion in
…/wp-includes/formatting.php
on line
1098What was wrong?
-
I’m confused. Is this coming from my plugin? This looks like an error with something calling a function in WordPress
I guess so. On my two pages where I use that plugin I have the same error in search form.
Here is the screen: https://adokasprzak.pl/temp/screen.png
What is the site URL? If you’re using my plugin, please can you disable it and see if this goes away.
Another option is to use Query monitor plugin or with Xdebug and see what is exactly triggering the error.
I use Query monitor…
Here is the screen:
https://adokasprzak.pl/temp/screen01.pngPage is: https://itlawyers.pl/lkhljhljkh
Thank you! This is very helpful. There is a bug in the shortcode for the form. It needs two parameters and only a single is passed.
Would you be able to fix this at your end?This line has to be changed:
https://github.com/WebberZone/better-search/blob/f5694407c53872f243f4179c5def8513d133a7b4/includes/modules/shortcode.php#L75return get_bsearch_form( '', $atts );I’ve filed this in Github:
https://github.com/WebberZone/better-search/issues/76It helped, there is no notice.
But searching is only possible in wordpress posts.
When I search woocommerce products or custom post types, plugin finds nothing.Have you included the custom post types in the Settings page > Search tab?
Yes, of course.
One thing to try is to see what query is being generated in Query Monitor and double-check that the post types are properly selected. I.e. product for WC.
Also worth turning on searching through meta fields in the settings page
Hi, yes I double checked – all post types are included in search (posts, custom post types, products…).
Searching in meta fields is on.Query Monitor:
SELECT option_value
FROM wp_options
WHERE option_name = ‘ald_bsearch_settings’
LIMIT 1Using search finds only in post (not cpt nor products)…
Please can you turn of the caching from the settings page.
The query to find is the one that has the MATCH (post_title) etc in the query. It might be one with the Main query and the function calling is WP_Query->get_posts()
Caching is turned off from the begining.
I do not get the rest You wrote.
What should I do to make it work?
In this tutorial – at the very bottom you see an example query. Ignore the filters.
https://webberzone.com/support/knowledgebase/debugging-with-query-monitor/
That’s what I am looking for – it’s different for Better Search but you’ll note the style.
I was thinking – you might also need to turn on the searching Meta checkbox in the Settings page > Search tab.
-
This reply was modified 4 years, 6 months ago by
Ajay.
-
This reply was modified 4 years, 6 months ago by
The topic ‘[Better Search] Notice : Array to string conversion’ is closed to new replies.