Skip to content

Region is being overridden when changing from a required-state country to one that is not required #10317

Closed
@nei

Description

@nei

On Magento 2.1.7 the user change the country from EUA with region Alaska to Uruguay for instance the region dropdown is hidden and the region input text is showed with Alaska as value..

So, if you change to XXX and save Magento is still posting the region_id Alaska and on the backend we are now checking if the region_id exists and if it does we override the value of region.

This behavior was introduced on this commit 7750415#diff-9fadca60a49535a2817d9fc5c4535d3a

My solution was to disable the region_id dropdown element so it will not be posted when it is hide.

Preconditions

  1. Magento 2.1.7
  2. PHP 7.0.4

Steps to reproduce

  1. Log into your Account on the frontend
  2. Edit your billing address and save using EUA for country and pick a state, save it.
  3. Edit your billing address again, change from EUA to Uruguay, change the region input for Test
  4. Save it and you will see EUA state still being showed.

Expected result

  1. After save you should be able to see the new state being displayed

Actual result

  1. After save it is showing the old state value.

Proposal Solution

Not post region_id if we don't need it.

region-updater.patch.txt

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releasebug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions