I updated SuiteCRM using the upgrade wizard from 7.10 to 7.12.10 version, everything went well but now, I noticed that there is an error when I use the Search bar of the CRM. I have checked the logs but I’m not sure to understand what to do. Here are the logs I get after a research :
The other post has an interesting bit of information: this seems to happen when searching in a module which is indexed, but has no items there yet. Simple workaround, I suppose, would be to create a dummy record in those modules…
But the main thing would be to use that insight to find the root cause and fix it…
In lib/Search/SearchResults.php, the getRelatedId function is defined as
protected function getRelatedId(SugarBean $obj, string $idName, string $link): string
It is supposed to return a string but it returns null in some cases, making the search crash…
The following looks like it fixes the problem.
At the end of the function, add:
if(!$relId) {
$relId =‘’;
}