Some files still use the DB global variable. #3705

Open
opened 2026-02-20 16:08:51 -05:00 by deekerman · 1 comment
Owner
Originally created by @connorshea on GitHub (Apr 30, 2019). Most of the `$db` globals were removed in [this commit](https://github.com/salesagility/SuiteCRM/commit/98e8b6e5d8125f2b268a9975cf3d472edebbd98a#diff-3577c448a121183734986b4b6f848826) (see also [this PR](https://github.com/salesagility/SuiteCRM/pull/5718)), but a decent number still exist. Files with a `$db` global: - [ ] [`modules/UserPreferences/UserPreference.php`](https://github.com/salesagility/SuiteCRM/blob/1892b13ecfcd9a9e3cd575c8b4b3336188e86f28/modules/UserPreferences/UserPreference.php#L259) - [ ] [`modules/Administration/updater_utils.php`](https://github.com/salesagility/SuiteCRM/blob/1892b13ecfcd9a9e3cd575c8b4b3336188e86f28/modules/Administration/updater_utils.php#L52) - [ ] [`modules/MailMerge/Step1.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/MailMerge/Step1.php#L65 ) - [ ] [`modules/Reminders/Reminder.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Reminders/Reminder.php#L290) - [ ] [`install/suite_install/AdvancedOpenSales.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/install/suite_install/AdvancedOpenSales.php#L31) - [ ] [`modules/Charts/Dashlets/PipelineBySalesStageDashlet/PipelineBySalesStageDashlet.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Charts/Dashlets/PipelineBySalesStageDashlet/PipelineBySalesStageDashlet.php#L262) - [x] [`modules/Emails/EmailUI.php`](https://github.com/salesagility/SuiteCRM/blob/1892b13ecfcd9a9e3cd575c8b4b3336188e86f28/modules/Emails/EmailUI.php#L2588) (#7262) - [ ] [`include/social/twitter/twitterapi.php`](https://github.com/salesagility/SuiteCRM/blob/80e9e484f7c00340a67a65efbf82aca2e3d5d141/include/social/twitter/twitterapi.php#L16) - [ ] [`modules/SecurityGroups/MassAssign.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/SecurityGroups/MassAssign.php#L10) - [ ] [`tests/api/_bootstrap.php`](https://github.com/salesagility/SuiteCRM/blob/611f7ac9c599768c57fc4cea2240ef27eec55078/tests/api/_bootstrap.php#L4) - [x] [`modules/Charts/Dashlets/OpportunitiesByLeadSourceDashlet/OpportunitiesByLeadSourceDashlet.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Charts/Dashlets/OpportunitiesByLeadSourceDashlet/OpportunitiesByLeadSourceDashlet.php#L209) (#7262) - [x] [`modules/Leads/views/view.convertlead.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Leads/views/view.convertlead.php#L697) (#7262) - [x] [`modules/Project/controller.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Project/controller.php#L92) (#7262) - [ ] [`include/Dashlets/DashletGenericChart.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/include/Dashlets/DashletGenericChart.php#L382) - [ ] [`tests/unit/_bootstrap.php`](https://github.com/salesagility/SuiteCRM/blob/dc0d25b3192e652156e3e6d822699814c9ac3d00/tests/unit/_bootstrap.php#L11) - [ ] [`modules/AM_ProjectTemplates/controller.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/AM_ProjectTemplates/controller.php#L38) - [ ] [`modules/AM_ProjectTemplates/controller.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/AM_ProjectTemplates/controller.php#L317) (same file, different line) - [ ] [`include/MassUpdate.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/include/MassUpdate.php#L180) - [ ] [`modules/OAuth2Tokens/OAuth2Tokens.php`](https://github.com/salesagility/SuiteCRM/blob/207f5f65d260b842b8883e591783608ec758b28d/modules/OAuth2Tokens/OAuth2Tokens.php#L129) - [ ] [`include/Localization/Localization.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/include/Localization/Localization.php#L198) - [ ] [`include/SubPanel/SubPanelRowCounter.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/include/SubPanel/SubPanelRowCounter.php#L116) - [ ] [`modules/Administration/UpgradeWizard_commit.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Administration/UpgradeWizard_commit.php#L104) - [ ] [`tests/bootstrap.php`](https://github.com/salesagility/SuiteCRM/blob/ee3fdb88b5145c5e69f77e138c8f5ee01bd17a49/tests/bootstrap.php#L50) - [x] [`modules/Project/chart.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Project/chart.php#L71) (#7262) - [x] [`modules/Project/Project.php`](https://github.com/salesagility/SuiteCRM/blob/ef1b41965c056937894dd3018d3b149c9c25a9a9/modules/Project/Project.php#L339) (#7262) Should these all be replaced by `DBManagerFactory::getInstance()` like the other commit? I got all these by [searching for `db global` in GitHub](https://github.com/salesagility/SuiteCRM/search?p=1&q=db+global&unscoped_q=db+global)
Author
Owner

@connorshea commented on GitHub (Jun 4, 2019):

This isn't really resolved :)

@connorshea commented on GitHub (Jun 4, 2019): This isn't really resolved :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#3705
No description provided.