Skip to content

Adminhtml Customer/Edit: allowed countries of selected website aren't considered when editing existing addresses #1762

Open
@Sdfendor

Description

@Sdfendor

Preconditions (*)

  1. Reproduced in 19.4.14 but exists for a long time in OpenMage (also present in Magento codebase)
  2. Fresh installation (demo shop) with the following characteristics:
    • An existing customer (one is able to log in to) assigned to the preinstalled website (the one entry in System > Manage Stores = "Main Website") must be present.
    • System config General > Countries Options > Allow Countries (general/country/allow) must contain a country in Website (or Store View) scope that is not allowed in default config scope i.e. it's selectable in shop frontend ("Main Website Store") but not in default store (admin store id 0) context.
      For the reproduction I've chosen Bulgaria as the one that is only allowed in shop frontend and Germany, Austria and Switzerland as the commonly allowed countries (Note: the countries will be shown translated in admin context (German)).

Steps to reproduce (*)

  1. In the shop frontend log in to existing customer.
  2. In Address Book add an address (the default address) for which the country must be set to the one that is allowed in the store but not in default config scope. Save the address.
    image
  3. In the admin area view/edit the existing customer and select the Addresses tab.
  4. The country will be empty because the select options of country are loaded for the default store (admin area, store id 0) not the appropriate website ("Main Website") of the edited customer.
    image

Expected result (*)

  1. The country list is filled with the allowed countries of the selected website of the edited customer.
  2. The previously selected country of the saved address (default address) is preselected from the list.
  3. The customer can be freely edited and saved without selecting a country first (required field).

Actual result (*)

  1. The country list is filled with the countries of the default store (admin area).
  2. No country is preselected for the saved address (default address).
    image
  3. The customer can't be freely edited and saved without selecting a country first (required field). This is even true if one edits fields in other tabs and don't load the Addresses tab.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions