Im trying to perform quick repair and rebuild after upgrading from 7.12 but It is stuck on comapring vardefs and I receive error regarding DBManager in php log:
[14-Jan-2025 16:45:07 Asia/Kuwait] PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in C:\CRM\wwwroot\include\database\DBManager.php:1048
Stack trace:
#0 C:\CRM\wwwroot\include\database\DBManager.php(1048): array_map('strtolower', 'Array')
#1 C:\CRM\wwwroot\include\database\SqlsrvManager.php(326): DBManager->compareVarDefs(Array, Array)
#2 C:\CRM\wwwroot\include\database\DBManager.php(991): SqlsrvManager->compareVarDefs(Array, Array)
#3 C:\CRM\wwwroot\include\database\DBManager.php(765): DBManager->repairTableParams('acl_actions', Array, Array, false, NULL)
#4 C:\CRM\wwwroot\modules\Administration\repairDatabase.php(121): DBManager->repairTable(Object(ACLAction), false)
#5 C:\CRM\wwwroot\modules\Administration\QuickRepairAndRebuild.php(140): include_once('C:\\CRM\\wwwroot\\...')
#6 C:\CRM\wwwroot\modules\Administration\QuickRepairAndRebuild.php(122): RepairAndClear->repairDatabase()
#7 C:\CRM\wwwroot\modules\Administration\views\view.repair.php(56): RepairAndClear->repairAndClearAll(Array, Array, false, true)
#8 C:\CRM\wwwroot\include\MVC\View\SugarView.php(210): ViewRepair->display()
#9 C:\CRM\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#10 C:\CRM\wwwroot\include\MVC\Controller\SugarController.php(363): SugarController->processView()
#11 C:\CRM\wwwroot\include\MVC\SugarApplication.php(101): SugarController->execute()
#12 C:\CRM\wwwroot\index.php(52): SugarApplication->execute()
#13 {main}
thrown in C:\CRM\wwwroot\include\database\DBManager.php on line 1048
I switched back to php 7.4 as I found this suggestion on forum here and the quick repair completes but it spits out complete nonsens on db repair script. For example:
/*INDEX MISMATCH WITH DATABASE - idx_del_user - ROW <name> idx_del_user <type> index <fields>[0] => 'deleted' [1] => 'assigned_user_id' */
/* VARDEF - idx_del_user - ROW<name> idx_del_user <type> index <fields>*/
DROP INDEX idx_del_user ON leads;;
CREATE INDEX idx_del_user ON leads (Array);;
CREATE INDEX idx_del_user ON leads (Array);; - instead of array there should be column list so I guess the DBManager.php script doesnât work properly.
I looked through this forum and git issues but havenât found anybody with the same problem.
Tested on PHP 8.1.9, same problem:
[14-Jan-2025 18:10:26 Asia/Kuwait] PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in C:\CRM\wwwroot\include\database\DBManager.php:1048
Stack trace:
#0 C:\CRM\wwwroot\include\database\DBManager.php(1048): array_map('strtolower', 'Array')
#1 C:\CRM\wwwroot\include\database\SqlsrvManager.php(326): DBManager->compareVarDefs(Array, Array)
#2 C:\CRM\wwwroot\include\database\DBManager.php(991): SqlsrvManager->compareVarDefs(Array, Array)
#3 C:\CRM\wwwroot\include\database\DBManager.php(765): DBManager->repairTableParams('acl_actions', Array, Array, false, NULL)
#4 C:\CRM\wwwroot\modules\Administration\repairDatabase.php(121): DBManager->repairTable(Object(ACLAction), false)
#5 C:\CRM\wwwroot\modules\Administration\QuickRepairAndRebuild.php(140): include_once('C:\\CRM\\wwwroot\\...')
#6 C:\CRM\wwwroot\modules\Administration\QuickRepairAndRebuild.php(122): RepairAndClear->repairDatabase()
#7 C:\CRM\wwwroot\modules\Administration\views\view.repair.php(56): RepairAndClear->repairAndClearAll(Array, Array, false, true)
#8 C:\CRM\wwwroot\include\MVC\View\SugarView.php(210): ViewRepair->display()
#9 C:\CRM\wwwroot\include\MVC\Controller\SugarController.php(432): SugarView->process()
#10 C:\CRM\wwwroot\include\MVC\Controller\SugarController.php(363): SugarController->processView()
#11 C:\CRM\wwwroot\include\MVC\SugarApplication.php(101): SugarController->execute()
#12 C:\CRM\wwwroot\index.php(52): SugarApplication->execute()
#13 {main}
thrown in C:\CRM\wwwroot\include\database\DBManager.php on line 1048