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

v2.11 fix(Address): Set name from firstname and lastname on update #4224

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Dec 16, 2021

Description

If use_combined_first_and_last_name_in_address is false (default in v2.11) and firstname and lastname are given in the changeset (ie. from a form) we need to make sure that name is set from it, otherwise data will be inconsistent.

Closes #4094

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen self-assigned this Dec 16, 2021
@tvdeyen tvdeyen changed the title fix(Address): Set name from firstname and lastname on update v2.11 fix(Address): Set name from firstname and lastname on update Dec 16, 2021
@tvdeyen tvdeyen marked this pull request as ready for review December 16, 2021 12:04
@tvdeyen tvdeyen removed their assignment Dec 16, 2021
@tvdeyen tvdeyen requested a review from a team December 16, 2021 12:32
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Left a question to better understand the context where this is a problem. Thanks Thomas!

core/app/models/spree/address.rb Show resolved Hide resolved
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

I'm ok with the fix, thanks, Thomas. Just left a couple of questions on the specs.

core/spec/models/spree/address_spec.rb Show resolved Hide resolved
core/spec/models/spree/address_spec.rb Outdated Show resolved Hide resolved
core/spec/models/spree/address_spec.rb Outdated Show resolved Hide resolved
@tvdeyen tvdeyen force-pushed the 4094-fix-address-update branch from 61891f4 to f56ab5b Compare December 28, 2021 10:17
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Left one non-blocking comment. Thanks for taking care of this, @tvdeyen!

core/spec/models/spree/address_spec.rb Show resolved Hide resolved
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

Looks good to me, only left a minor cleanup note but not blocking... thanks!

core/spec/models/spree/address_spec.rb Outdated Show resolved Hide resolved
If use_combined_first_and_last_name_in_address is false (default) and firstname and lastname are given in the changeset (ie. from a form)
we need to make sure that name is set from it, otherwise
data will be inconsistent.

Closes solidusio#4094
@tvdeyen tvdeyen force-pushed the 4094-fix-address-update branch from f56ab5b to a09c84c Compare January 7, 2022 15:31
@tvdeyen tvdeyen merged commit f64f0f6 into solidusio:v2.11 Jan 7, 2022
@tvdeyen tvdeyen deleted the 4094-fix-address-update branch January 7, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants