After freshly installing Suitecrm, I executed repair and rebuild and found some issues in it.
First of all, inside ModuleInstall\ModuleInstaller.php file we’ve rebuild_all() function. So this function executes rebuild_relationships first and then rebuild_tabledirectory.
Now rebuild_relationships require tabledirectory.ext.php file. But this file is getting created inside rebuild_tabledirectory(), so this function doesn’t get this file and it misses the exections of relationships inside tabledirectory.ext.php file… Weird!
Now another point is for unknown reason, global $beanList variable inside sugarbean.php → createRelationshipMeta() function doesn’t contain all the beans for the first execution of repair and rebuild but for second execution it contains more beans out of which I needed EBSI_Correspondense for displaying correspondense tab in the case detail page.
Can someone check this and help in this?
Is this with suite 7 suite 8?
You should post this as a new issue on github!
Please open a New Issue , with the full details from your original post in this thread, and include a link to this post!
@chris001 new Issue is raised in github. Waiting for the updates on it.
opened 12:07PM - 30 Apr 24 UTC
<!--- Please be aware that as of the 31st January 2022 we no longer support 7.10… .x.
New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above.
If your issue is still applicable in 7.12.x, please create the issue following the template below -->
#### Issue
Quick Repair & Rebuild not working as expected at the first execution after Suitecrm is installed.
After freshly installing Suitecrm, I executed repair and rebuild and found some issues in it.
First of all, inside ModuleInstall\ModuleInstaller.php file we’ve **rebuild_all()** function. So this function executes **rebuild_relationships()** first and then **rebuild_tabledirectory()**.
Now rebuild_relationships require tabledirectory.ext.php file. But this file is getting created inside rebuild_tabledirectory(), so this function doesn’t get this file and it misses the exections of relationships inside tabledirectory.ext.php file… Weird!
Now another point is for unknown reason, global $beanList variable inside sugarbean.php → createRelationshipMeta() function doesn’t contain all the beans for the first execution of repair and rebuild but for second execution it contains more beans out of which I needed EBSI_Correspondense for displaying correspondense tab in the case detail page.
This issue is already created in the forum
https://community.suitecrm.com/t/repair-and-rebuild-not-working-properly/92599
#### Expected Behavior
For first point, I believe **rebuild_tabledirectory()** should be executed first and not **rebuild_relationships()** & for second point, it should get all the beans in the $beanlist.
#### Actual Behavior
As mentioned, it is not getting tabledirectory.ext.php file for relationships executions and for second point, $beanlist doesn't contain all the beans.
#### Possible Fix
execute **rebuild_tabledirectory()** first and then **rebuild_relationships()**.
For second point, I am not sure.
#### Steps to Reproduce
1. Install suitecrm application
2. Set log level to "Info"
3. add logs here https://github.com/salesagility/SuiteCRM/blob/hotfix/modules/Administration/RebuildRelationship.php#L94 & https://github.com/salesagility/SuiteCRM/blob/hotfix/data/SugarBean.php#L739
4. do quick repair and rebuild via web or via cli.
5. check the log (basically copy those two logs in another file)
6. clear the log
7. repeat step number 4
8. check those 2 logs again and compare it with first log
#### Context
basically, in the deployment process we are executing this repair via cli as our deployment process so that we don't have to manually do it via web. But as it not working as expected we have to manually go to web and hit quick repair and rebuild.
I believe this is HIGH priority bug.
#### Your Environment
* SuiteCRM Version used: 7.4.3
* Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Google Chrome 123.0.6312.86 (Official Build) (32-bit)
* Environment name and version (e.g. MySQL, PHP 7): MariaDB : 5.5.5-10.1.21, PHP 5.3
* Operating System and version (e.g Ubuntu 16.04): Windows 32 Bit