Skip to content

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

Merged
tvdeyen merged 1 commit intosolidusio:v2.11from
tvdeyen:4094-fix-address-update
Jan 7, 2022
Merged

v2.11 fix(Address): Set name from firstname and lastname on update#4224
tvdeyen merged 1 commit intosolidusio:v2.11from
tvdeyen:4094-fix-address-update

Conversation

@tvdeyen
Copy link
Copy Markdown
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
Copy Markdown
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!

Comment thread core/app/models/spree/address.rb
Copy link
Copy Markdown
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.

Comment thread core/spec/models/spree/address_spec.rb
Comment thread core/spec/models/spree/address_spec.rb Outdated
Comment thread core/spec/models/spree/address_spec.rb Outdated
@tvdeyen tvdeyen force-pushed the 4094-fix-address-update branch from 61891f4 to f56ab5b Compare December 28, 2021 10:17
Copy link
Copy Markdown
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!

Comment thread core/spec/models/spree/address_spec.rb
Copy link
Copy Markdown
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!

Comment thread core/spec/models/spree/address_spec.rb Outdated
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