Skip to content

Incorrect orders updated #19258

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

Closed
shachiarkatkar opened this issue Nov 17, 2018 · 19 comments
Closed

Incorrect orders updated #19258

shachiarkatkar opened this issue Nov 17, 2018 · 19 comments
Labels
Component: Sales Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@shachiarkatkar
Copy link

Preconditions (*)

  1. Magento 2.2.5
  2. Php 7.0

Steps to reproduce (*)

  1. Open order grid in two tabs.
  2. Apply filter of order status in both tabs. Both tabs should show same orders. (ex. pending)
  3. Select first order in first tab and change the status of order(ex. change to hold).
  4. Without refresh select same order in second tab and update status(ex. change to cancel)

Expected result (*)

  1. It should show exception message saying "Cant update order" or "No order to update" with id
    image

Actual result (*)

  1. All orders were updated to cancel status except the one updated in first tab.
    image
@magento-engcom-team
Copy link
Contributor

Hi @shachiarkatkar. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@shachiarkatkar do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 17, 2018
@shachiarkatkar
Copy link
Author

This issue replicated in vanilla Magento instance

@shachiarkatkar
Copy link
Author

@magento-engcom-team have checked on clean 2.2.5 and 2.3-dev branch got same error

@konarshankar07
Copy link
Contributor

konarshankar07 commented Nov 17, 2018

@shachiarkatkar
I think the orders which are on hold status are not able to cancel that's the way Magento works. Hope this will help you.

@shachiarkatkar
Copy link
Author

@konarshankar07 its not just about hold status but the other orders shouldn't be updated. Please check Following code in vendor/magento/module-ui/Component/MassAction/Filter.php:

  • Adds filters to collection using DataProvider filter results
    *
    • @param AbstractDb $collection

    • @return AbstractDb

    • @throws LocalizedException
      */
      public function getCollection(AbstractDb $collection)
      {
      $selected = $this->request->getParam(static::SELECTED_PARAM);
      $excluded = $this->request->getParam(static::EXCLUDED_PARAM);

      $isExcludedIdsValid = (is_array($excluded) && !empty($excluded));
      $isSelectedIdsValid = (is_array($selected) && !empty($selected));

      if ('false' !== $excluded) {
      if (!$isExcludedIdsValid && !$isSelectedIdsValid) {
      throw new LocalizedException(__('Please select item(s).'));
      }
      }
      /** @var \Magento\Customer\Model\ResourceModel\Customer\Collection $collection */
      $idsArray = $this->getFilterIds();
      if (!empty($idsArray)) {
      $collection->addFieldToFilter(
      $collection->getIdFieldName(),
      ['in' => $idsArray]
      );
      }
      return $collection;
      }

It returns whole collection because $idsArray is empty, if the order is already updated in other tab as it is not actually present in grid. Hence whole collection is affected. Please guide.

@konarshankar07
Copy link
Contributor

@shachiarkatkar
I tried to reproduce the issue but I'm not able to do it. I followed the following step to reproduce.
1)On the first tab, I change the order status to hold
2)On the second tab, I change the order status to unhold (without reloading the tab).
Its working fine in 2.2.5. Let me know if I missed any step to reproduce this issue.
Thanks

@shachiarkatkar
Copy link
Author

Try to cancel the order in second tab

@ratnesh-kadam
Copy link

@magento-engcom-team
Please follow following steps to reproduce the error:

  1. Open order grid in two tabs.
  2. Apply filter of order status in both tabs. Both tabs should show same orders.
  3. Select first order in first tab and change the status of order.
  4. Without refresh select same order in second tab and update status

Expected result:
It should throw error that cant update order as it is already updated and not showing in that filtered view.

Actual Result:
All orders are updated except the one selected.

@ghost ghost self-assigned this Nov 21, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 21, 2018

Hi @engcom-backlog-andrii. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: Sales Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 21, 2018
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-andrii Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-96556, MAGETWO-96557 were created

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 21, 2018
@ghost ghost removed their assignment Nov 21, 2018
@krnshah
Copy link
Contributor

krnshah commented Nov 24, 2018

Hi @shachiarkatkar,

As per your given step i have tried to reproduce the issue but i cant reproduce.

-- Set filter to pending status in both the tab.
-- Select the order and change the order status of that order in first tab.
-- Select the same order in second tab after redirect to the order detail. It will not giving any error msg. But the order status will change as we select in first tab.

Please let me know if i am wrong.

@ghost
Copy link

ghost commented Nov 26, 2018

Hi @krnshah. But we must got message after that. In second tab there is no message "Can't update order" or some else after update status as it is already updated in first tab and not showing in that filtered view.

@shikhamis11
Copy link
Member

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11, here is your Magento instance.
Admin access: https://i-19258-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

shikhamis11 pushed a commit to opencommerce/magento2 that referenced this issue Jan 16, 2019
Fixed magento#19258 Incorrect orders updated
@magento-engcom-team
Copy link
Contributor

Hi @shachiarkatkar. Thank you for your report.
The issue has been fixed in #20349 by @shikhamis11 in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 26, 2019
magento-engcom-team added a commit that referenced this issue Jan 26, 2019
 - Merge Pull Request #20349 from opencommerce/magento2:2.3-developPR19258
 - Merged commits:
   1. 56c1b33
magento-engcom-team added a commit that referenced this issue Jan 26, 2019
 - Merge Pull Request #20349 from opencommerce/magento2:2.3-developPR19258
 - Merged commits:
   1. 56c1b33
   2. d55f47d
irajneeshgupta pushed a commit to irajneeshgupta/magento2 that referenced this issue Jan 27, 2019
Fixed magento#19258 Incorrect orders updated
irajneeshgupta pushed a commit to irajneeshgupta/magento2 that referenced this issue Jan 29, 2019
Fixed magento#19258 Incorrect orders updated
@irajneeshgupta
Copy link
Member

@magento-engcom-team give me 2.2-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @irajneeshgupta. Thank you for your request. I'm working on Magento 2.2-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @irajneeshgupta, here is your Magento instance.
Admin access: https://i-19258-2-2-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants