Add blank line button should submit changes before it adds a new line

Project: 
Ubercart
Category: 
bug report
Version: 
Dev version
Priority: 
critical
Status: 
active

Duplicate the problem:
Login as admin. Create a new order. Click "Add blank line" button. Enter in Qty, Name, Model, Weight, Cost, Price information.
Click "Add blank line" button again. Another blank line shows up but data entered on previous line is lost.
Possible solution:
When clicking "Add blank line" button have it submit changes to the order first.

This is also an issue when deleting a line. Any changes to the form is reset after deleting a line.

Re: Add blank line button should submit changes before it adds a

Very interesting... I wonder why it would be wiping the old data, too. I'll investigate when I'm back in the office. Thanks for the post. Smiling

Another strange thing

Again as an admin in orders area...

  1. Create new order or use an existing one
  2. Add products to it from the product catalog
  3. Add a few blank lines using the "Add blank line" button
  4. Add another product from the catalog
  5. In my tests I find that the product from the catalog overwrites/deletes the blank line item

Related Usability Note

  1. Create new order in admin area
  2. Add customer shipping and billing information
  3. Add product to the order
  4. The product is added to the other without any additional buttons being clicked but the shipping and billing information isn't
    1. It has been very confusing to some store admins that they would need to push "Submit changes" when creating an order. They also get confused that the product would save to the order but the shipping/billing doesn't. I know why because I understand what it's doing - normal store admins do not.
      Another reason why it would be helpful if adding a product to the order saved the order as mentioned above.

Re: Related Usability Note

Thanks for the posts, Kai. I've committed in revision 1054 what I believe to be a sufficient fix. It does the following things:

  1. Adds a throbber when you click on buttons w/ pending action.
  2. Passes in all product data when adding blank lines/products or removing products to be saved prior to the action.

Be sure to refresh your order edit page to clear your browser cached JS and give it a shot. Let me know if I missed anything. Smiling