Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9654 - Fix issue with different date formats being compared for change log #9657

Merged
merged 1 commit into from Jun 22, 2023

Conversation

JackBuchanan
Copy link
Contributor

Call fixUpFormatting before comparing values for change/audit log

Description

Call fixUpFormatting before comparing values for change/audit log

Motivation and Context

getDataChanges(include/database/DBManager.php) will not fix formatting before comparing values.
Depending on functionality that could be added in save hook getDataChanges can potentially be comparing values with different formats. e.g. Save hook uses retrieve: $contact->retrieve($contact->id);
Dates returned using retrieve are set in user pref format: 22-07-2022
When passed into getDataChanges the date is compared against DB format: 2022-07-22
Although date are the same the change log believes they are different: 22-07-2022 !== 2022-07-22

How To Test This

Create aftersave hook
Set user pref date format to non-db format
Use retrieve on bean you are saving: $contact->retrieve($contact->id);
Check modules audit log for changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

…ompared for change log

Call fixUpFormatting before comparing values for change/audit log
@jack7anderson7 jack7anderson7 added Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Branch:Hotfix labels Sep 26, 2022
@jack7anderson7 jack7anderson7 added the Status: Requires Code Review Needs the core team to code review label Feb 27, 2023
Copy link
Contributor

@clemente-raposo clemente-raposo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clemente-raposo clemente-raposo added Status: Requires Testing Requires Manual Testing Status: Passed Code Review Mark issue has passed code review reviewed and removed Status: Requires Code Review Needs the core team to code review labels Apr 13, 2023
@johnM2401 johnM2401 added Status: Passed Testing and removed Status: Requires Testing Requires Manual Testing labels Jun 5, 2023
Copy link
Contributor

@johnM2401 johnM2401 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Dates saving as expected

Checked saving Dates at each Date Format, and seems to save well

@jack7anderson7 jack7anderson7 merged commit 3ca2462 into salesagility:hotfix Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Branch:Hotfix Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Passed Code Review Mark issue has passed code review reviewed Status: Passed Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants