Unsupported operand types: int * string in lib/search.php:918
-
Hi there,
I’m getting this intermittent – as in, it happens for some search terms but not for others – error when searching in the front-end:
Unsupported operand types: int * string in /blahblahblah/public_html/wp-content/plugins/relevanssi/lib/search.php:918
If I do some debugging of that code:
$weight = $post_type_weights[ 'post_tagged_with_' . $tax ] ?? null;
write_log($weight); // $weight is null at this point
if ( ! $weight ) {
$weight = $post_type_weights[ $tax ] ?? 1;
}
write_log($weight); // but it's still blank now, and that's because $post_type_weights looks like: Array
(
[post_tag] => 0.75
[category] =>
)
// so if I add something like this:
if ( ! $weight ) {
$weight = 1;
}
// then the error doesn't happen, but otherwise doing this throws that int * string error:
$match_object->taxonomy_score += $count * $weight;Any ideas, please? As I say, if I add a hack to force $weight = 1 then I can get around it, but I don’t want to put my ugly code in your marvellous plugin if I can help it…!
Thanks very much.
ian.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.