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

[6.x] Model dirty check bug fix #30565

Merged
merged 1 commit into from
Nov 12, 2019
Merged

[6.x] Model dirty check bug fix #30565

merged 1 commit into from
Nov 12, 2019

Commits on Nov 12, 2019

  1. update Model dirty check

    for attributes that are cast to any type of Object, the strict equivalency (`===`) will never return `true`, because even though the values may be equal, the Object there reference will be different.
    
    this changes checks if the cast type is either `object` or `collection`, both with return Objects, and uses loose equivalency to compare them.
    
    even though date casting also returns an Object, we don't need to handle that since it's handled in the previous conditional.
    
    the test represents a scenario that occurs when using JSON fields in MySQL. MySQL returns the value with spaces between the elements, but `json_encode` returns a string **without** spaces between the elements.
    browner12 committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    92428c2 View commit details
    Browse the repository at this point in the history