0

Steps to reproduce:

  1. Click Edit on first order, i.e 000000001
  2. Click Edit on second order, i.e 000000002
  3. Click Add Products on first order edit screen
  4. Select any product and click Add Selected Product(s) to Order

You'll now see that the contents of 000000001 are all of the product(s) from 000000002 - as well as the product you selected.

I've also noticed some strange behavior when it comes to placing the orders after editing them whereby for instance the editing of 000000002 will result in it's new increment id being 000000001-1.

I think this bug may stem from the adminhtml/session_quote object (app/code/core/Mage/Adminhtml/Model/Session/Quote.php). Does this mean that Magento can only handle the editing of a single order per session? Surely it would differentiate between the session objects using the parent entity id or something along those lines?

Edit: The same behavior is experienced when placing two orders simultaneously, which leads me to believe it's definitely related to the inability to split the adminhtml/session_quote objects on a per parent order entity id basis.

2

I don't think this is a bug. It's rather a limitation on how the admin edit order is implemented.
When you hit Edit on and order (and when you create and order from scratch) in the backend the session is involved. See how the Mage_Adminhtml_Sales_Order_EditController and Mage_Adminhtml_Sales_Order_CreateController classes look like and what they do.

So when you hit edit on the second order, the session is cleared (see Mage_Adminhtml_Sales_Order_EditController::startAction) and you are not editing the first order anymore.

But the form from the first edited order is filled with data from the first order. only the ajax calls you make from this point on in the edit order screen will return values from the second order you edit.
That's why you get mixed results from the first and second order.

When submiting the form from the first order, you are submitting data like customer id or currency from the first order but you got the items from the second order.

The lesson here is to never edit 2 orders within the same session.

  • you're right, it is a limitation. It's a pretty annoying one. Have you ever seen a work-around for this? – Moose Dec 15 '14 at 9:32
  • I totally agree, it's better to not edit 2 orders at the same time. It's the same with products, when you edit two products at the same time, we have experienced these kind of issues as well (products appearing in the wrong category, and URL issues). Better to open an incognito window (or a different browser, not a browser window), when you'd like to do multiple edits at once, so it creates a new session. – Niels Dec 15 '14 at 9:33
  • I got a complaint like this a few years ago from the gals working on the sales department for a website I've been working on. That's why I know how this works. I tried to change the way the edited orders are kept in the session, buy involving the order id of the order being edited and a random string when an order is created but ended up spending too much time on it without any conclusive results so "we" took the decision to drop it. The only workaround was to use 2 different sessions (2 different browsers) when editing 2 orders. Sorry I have nothing else on this. – Marius Dec 15 '14 at 9:35
  • No problem! Appreciate the insight. I believe we'll likely also take that approach. – Moose Dec 15 '14 at 9:38
  • @user5972 - regarding your mention of the duplicate product editing "limitation". I've tested that quite thoroughly and am not able to reproduce this in 1.7.0.2, it works perfectly fine for me when editing both categories & URLs simultaneously between products. – Moose Dec 15 '14 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.