The admin create order / edit order functionality appears non-functional. Create order does indeed create an order, but it doesnt appear possible to attach any information to it. Create user does not attach, and address information doesnt appear to submit to the order - the ajax functionality all seems to be disabled.

Add product and Add blank line dont produce on screen changes, however Add Blank Line does appear to modify the order, as the blank line appear on a screen refresh.

I'm nowhere on AJAX so unfortunately can't provide much further insight.

Happy to help test or provide further info if pointed in right direction.

CommentFileSizeAuthor
#7 1057124-uc_order-ajax-edit.patch4.11 KBlongwave

Comments

essbee’s picture

Priority: Normal » Major

Well I've chassed this round and round the merry go round and have firmly confirmed that it is beyond my skill level.

The problems from what I can assess are in uc_order.order_pane.inc

I'm pretty sure the AJAX callback function is effectively populating div id="product_controls" with nothing because $form['product_controls'] isn't being populated. It would appear that function uc_order_product_select_form() never gets called, which is bad seeing as that appears to be the function responsible for populating $form['product_controls'] .

function uc_order_pane_products_select() gets called properly and from what I can garner appears to populate the array of products for use in creating the form. From what I can tell uc_order_product_select_form() is then supposed to use that array to generate the form structure in $form['product_controls'].

Given that uc_order_product_select_form() is the only function that appears to utilise the state of $form_state['products_action'] = 'select' and the array held in $form_state['product_select_options'], it would appear that this is the issue. I tried manually calling uc_order_product_select_form() at the end of the uc_order_pane_products_select() but that didnt have any impact.

Apologies if this looks like a complete load of nonsense, I'm trying to provide as much as I can without fully understanding the interactions going on between the various helper functions.

I have increased the priority on this as there is no way to edit orders in ubercart's current state, which I imagine is a bit of a deal breaker in many situations.

longwave’s picture

#975194-14: Create Order does not follow email address tag recommendations, and gives error should fix the "create order" part of this, but the "edit order" bits I haven't looked at yet.

longwave’s picture

Title: Can't create orders via admin/store/orders/##/edit » Can't edit orders via admin/store/orders/##/edit

Fixing title. Thank you for describing your attempts at tracking down the issue, they are helpful even if you can't pinpoint the exact cause, as it gives the maintainers a starting point when looking at complicated issues like this one.

essbee’s picture

Making very limited progress with this.

If i force the product select form to be displayed on page load then the form displays correctly with appropriate products. However the form is non functional, products re not added to the order on select, and search functionality doesnt work.

interestingly I can generate manipulate the order of the functions to produce the form array form['product_controls'], but attempting to render this produces an AJAX error.

I suspect these all have a similar root cause but can not for the life of me identify.

essbee’s picture

Is there a tag being used to highlight issues that are full release blockers?
If so this would require said tag.

Island Usurper’s picture

Issue tags: +Release blocker

Looks like there is a tag. We're also going to start using it.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new4.11 KB

Patch attached that should fix this. This fixes a few problems:

  • Looks like we need to set #rebuild in the various submit handlers for the add product/add blank line buttons to work correctly.
  • The final "add to order" button can also use an Ajax refresh to update the product list when it's done, it shouldn't have to submit the entire page.
  • There was some funky JavaScript for "order holds" which locked the submit button until all parts of the page had loaded, not sure this is needed now we have better Ajax functionality, and it stopped the main "Submit changes" button from working, so I removed it.
  • There was a typo (product_seelct_options) in one line.

uc_payment looks like it needs further work to edit orders using the new Ajax framework, but let's get product editing fixed to start with.

tr’s picture

Status: Needs review » Reviewed & tested by the community

I was able to reproduce the reported bug, and I can confirm that the patch in #7 fixes it.

tr’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed.