Function getRelatedId cannot return NULL value #10107
Labels
Area: PHP8
Issues & PRs related to the CRM when using PHP8
Priority:Important
Issues & PRs that are important; broken functions, errors - there are workarounds
Status:Fix Proposed
A issue that has a PR related to it that provides a possible resolution
Type:Bug
Bugs within the core SuiteCRM codebase
Type:Duplicate
Issues & PRs which are a duplicate of an existing issue/PR
Issue
function getRelatedId in lib/Search/SearchResults.php in unable to return null value due to return types
If function is unable to retrieve related ID then null is returned, but function return type prevent this from happening
Expected Behavior
Function should be allowed to return a NULL value
Actual Behavior
A 500 error is returned
Possible Fix
Allow function to return NULL values
Steps to Reproduce
Issue occurs when searching, see error: SuiteCRM\Search\SearchResults::getRelatedId(): Return value must be of type string, null returned
Context
Issue occurs when using basic search
Your Environment
The text was updated successfully, but these errors were encountered: