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

Save region correctly to save sales address from admin [backport] #11234

Merged

Conversation

raumatbel
Copy link
Contributor

@raumatbel raumatbel commented Oct 4, 2017

Related with PR#11381

Description

Save region correctly to save sales address from admin

Fixed Issues (if relevant)

  1. State/Province Not displayed after edit Billing Address on Sales Orders - Backend Admin. #10441: State/Province Not displayed after edit Billing Address on Sales Orders - Backend Admin.

Steps to reproduce

  1. Go to the backend -> Sales -> Orders -> View any order.
  2. Select the section -> Information -> Address Information
  3. Edit Billing Address, for example the street address.
  4. Save Order Address.

Note: The same issue happen with the Shipping Address.

Manual testing scenarios

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@okorshenko
Copy link
Contributor

Hi @raumatbel I just sent you an invitation to magento/magento2 repo. Could you please accept it

@raumatbel
Copy link
Contributor Author

@okorshenko Accepted

@okorshenko okorshenko self-assigned this Oct 4, 2017
@okorshenko okorshenko added this to the October 2017 milestone Oct 4, 2017
@raumatbel
Copy link
Contributor Author

raumatbel commented Oct 5, 2017

@okorshenko I have a problem with travis. The error shown is the next.
travis
In my code, in the line 18, I only extend the class (similar like the origin file)
class
What is the best solution to solve this?


/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveParameterList)

Choose a reason for hiding this comment

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

@SuppressWarnings(PHPMD.ExcessiveParameterList) should be used for the constructor.

OrderManagementInterface $orderManagement,
OrderRepositoryInterface $orderRepository,
LoggerInterface $logger,
RegionFactory $regionFactory

Choose a reason for hiding this comment

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

Please use approach for extending constructor arguments in backward compatible way

* @param array $attributeValues
* @return void
*/
protected function updateRegionData(&$attributeValues)

Choose a reason for hiding this comment

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

Passing arguments by reference is not recommended. Return modified data instead (possible memory usage optimization is not so important here).

* @param array $attributeValues
* @return array
*/
protected function updateRegionData($attributeValues)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this method protected? Is it referenced from the children classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vrann this function is only used in this class. I have updated the visibility to private.

@okorshenko okorshenko assigned vrann and okorshenko and unassigned raumatbel Oct 11, 2017
@raumatbel raumatbel changed the title Save region correctly to save sales address from admin Save region correctly to save sales address from admin [backport] Oct 11, 2017
denisristic pushed a commit to denisristic/magento2 that referenced this pull request Oct 12, 2017
* 'develop' of github.com:magento/magento2: (4059 commits)
  MAGETWO-81324: Fix functional test fails randomly
  MAGETWO-80916: Save region correctly to save sales address from admin magento#11234
  Improve constructor arguments, arguments by reference is not valid and change SuppressWarnings
  MQE-428: Update Magento2 Acceptance Readme File
  MQE-352: Review and Update SampleCest.xml for added functionality
  MQE-415: Change required-entity's persistedKey in test schema to createDataKey
  MQE-335: Headless Browser Spike - Updating all @env tags for tests. Only listing the ones that the test works in currently. - Updating README. Replacing "Acceptance" with "Functional". - Adding Headless command to robo.
  MAGETWO-80319: Remove array indexing by entityId magento#11086
  Error CBO coupling between object.
  Error CBO coupling between object.
  Error CBO coupling between object.
  Error CBO coupling between object.
  Fix Code Style and Codacy Variable too long
  Error CBO coupling between object.
  Add Test to cover cancel Invoice
  MQE-424: Fix static code issues in MFTF tests and MFTF
  Solve error Field declared dynamically
  Solve error PHP Code Sniffer
  FR#StateNotDisplayedSalesAdminAddress Save region correctly to save sales address from admin
  MQE-419: README.MD should not reference the magento-pangolin org
  ...
@magento-team magento-team merged commit d5cd66f into magento:develop Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants