I have come across a strange issue that I would like some feedback on. I am currently working through various issues of migrating SugarCRM 6.5.25 → SuiteCRM 8.9.1.
I’ve been able to work through many items, mostly messed up layout defs, but this one has me scratching my head.
Scenario: a user wants to search for an opportunity record so they perform a search and select only the ‘Opportunities’ module.
When they attempt to search, they receive an error: “An unknown error has occurred while performing the search. Contact an administrator if the problem persists. More information available in the logs.”
When I go sleuthing through the logs I find this stacktrace:
Fri Jan 2 2026 at 23:53:14 [165031][d7de7ef6-7d11-1bad-2376-68f81ae726a4][FATAL] [ERROR] [SearchThrowableHandler] TypeError: Unsupported operand types: int + string in /var/www/suite8/public/legacy/include/database/DBManager.php:1596
Stack trace:
#0 /var/www/suite8/public/legacy/include/SearchForm/SearchForm2.php(1378): DBManager->quoteType()
#1 /var/www/suite8/public/legacy/lib/Search/BasicSearch/BasicSearchEngine.php(172): SearchForm->generateSearchWhere()
#2 /var/www/suite8/public/legacy/lib/Search/BasicSearch/BasicSearchEngine.php(85): SuiteCRM\Search\BasicSearch\BasicSearchEngine->searchModules()
#3 /var/www/suite8/public/legacy/lib/Search/SearchEngine.php(78): SuiteCRM\Search\BasicSearch\BasicSearchEngine->search()
#4 /var/www/suite8/public/legacy/lib/Search/SearchWrapper.php(89): SuiteCRM\Search\SearchEngine->searchAndDisplay()
#5 /var/www/suite8/public/legacy/modules/Home/Search.php(50): SuiteCRM\Search\SearchWrapper::searchAndDisplay()
#6 /var/www/suite8/public/legacy/modules/Home/UnifiedSearch.php(41): require_once('...')
#7 /var/www/suite8/public/legacy/include/MVC/View/SugarView.php(800): include_once('...')
#8 /var/www/suite8/public/legacy/include/MVC/View/views/view.classic.php(72): SugarView->includeClassicFile()
#9 /var/www/suite8/public/legacy/include/MVC/View/SugarView.php(210): ViewClassic->display()
#10 /var/www/suite8/public/legacy/include/MVC/Controller/SugarController.php(443): SugarView->process()
#11 /var/www/suite8/public/legacy/include/MVC/Controller/SugarController.php(374): SugarController->processView()
#12 /var/www/suite8/public/legacy/include/MVC/SugarApplication.php(101): SugarController->execute()
#13 /var/www/suite8/public/legacy/index.php(52): SugarApplication->execute()
#14 {main}
After digging in and adding some debug code, it appears that the opportunities.amount field (which is a currency type) has a blank value instead of a numeric value in include/SearchForm/SearchForm2.php line 1378
Any idea why this is happening? I could temporarily fix this by checking if the value is blank and assigning it a 0 value, but that would be modifying core code and I’m not about that.
Thanks in advance!