mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
repair database on 7.14 does not match for default with decimals #5140
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#5140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Dec 28, 2023).
When you execute a repair database on 7.14.2 does not match default value between vardefs and database for decimal fields configured with a default.
Issue
Database is MariaDB 10.5.21

In vardefs.php fields are defined this way:
'rate' => array(
'required' => true,
'name' => 'rate',
'vname' => 'LBL_RATE',
'type' => 'decimal',
'massupdate' => 0,
'default' => 1.000000,
'no_default' => false,
'comments' => '',
'help' => '',
'importable' => 'true',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => '0',
'audited' => true,
'inline_edit' => true,
'reportable' => true,
'unified_search' => false,
'merge_filter' => 'disabled',
'len' => 26,
'size' => '26',
'enable_range_search' => true,
'precision' => 6
),
In database
In fields_def rate will have default = 1 (without decimals) so in include/database/DBManager.php when compares in compareVarDefs function does not match because cast to string (so 1 is different to 1.000000).
Expected Behavior
It should be match anyway.
Actual Behavior
Studio accepts only default with decimals so any time we execute repair this fields has included to repair.
Possible Fix
We should change fields_defs definition so when compares it matches or add a compare for default value when decimal
Your Environment
PHP 8.2
MariaDB 10.5.21
@johnM2401 commented on GitHub (Apr 9, 2024):
Hey!
Thank you for getting in touch!
Are you still experiencing these issues?
I've given this a few tries, but i'm afraid i've been unable to replicate as of yet.
I've created the following custom field in Accounts, via Studio, which has a default of "1.000000"


However, running Repair->Quick Repair and Rebuild does not appear to give me the prompt to Execute changes
(ie: No difference is found between CRM/Database)
Have I perhaps misunderstood or missed a replication step?
Please let me know if you have any further information.
Thanks again!
@serhiisamko091184 commented on GitHub (Oct 7, 2024):
Hello @pqe-develop,
This issue has been marked as stale because there has been no recent activity. It will be closed if no further activity occurs.
Thanks for your contributions.
Regards,
Serhii