the 'add line' item is always disabled on 'admin/store/orders/xxx/edit'

I can select 2 items in the menu in the same pane ('shipping' and 'empty line') but the 'add line' buttons stays disabled?

Any clues?

Comments

bwynants’s picture

If i go to admin/store/orders/xxx/add_line_item/shipping via an url it works just fine... so my only problem is the disabled button...

bwynants’s picture

Category: support » bug
Status: Active » Needs work

one part of the problem is in uc_order_pane_line_items

    case t('Add line'):
      drupal_goto('admin/store/orders/' . $form_state['values']['order_id']
                 . '/add_line_item/' . $form_state['values']['li_type_select']);

should be

    case t('Add line'):
      drupal_goto('admin/store/orders/' . $form_state['order_id']
                 . '/add_line_item/' . $form_state['li_type_select']);

and then the disabled should become false where the button is created

      $form['add_line_item']['actions']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Add line'),
        '#attributes' => array('class' => array('save-button')),
        '#disabled' => FALSE,
      );
bwynants’s picture

okay, button never got enabled because 'release_held_buttons' was removed from uc_order.js

bwynants’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new3.25 KB

patch included

bwynants’s picture

StatusFileSize
new2.96 KB

correct patch

longwave’s picture

I wonder if we even need this "order holds" mechanism at all, I am not sure why it is needed.

bwynants’s picture

today it is still is used in payment module #1187018: javascript function missing. So if it is not needed we should remove it there. and also the 'add line' button was depending on it....

longwave’s picture

Status: Needs review » Fixed

Committed the uc_order.order_pane.inc part of this patch, as the order hold mechanism is now removed.

bwynants’s picture

somehow i miss one change in uc_order.js i'm not sure if i ever created a patch for it...

@@ -258,36 +254,7 @@ function close_customer_select() {
 function confirm_line_item_delete(message, img_id) {
   if (confirm(message)) {
     var li_id = img_id.substring(3);
-    jQuery('[name=li_delete_id]').val(li_id);
+    jQuery('#edit-li-delete-id').val(li_id);
     jQuery('#uc-order-edit-form #edit-submit-changes').get(0).click();
   }
 }

needed to be able to delete the lines you added

-/+ are reverted because it's a div with my branch

OldAccount’s picture

Confirming the #5 patch works. Applied the uc_order.order_pane.inc part only and now the "Add line" button is re-enabled on the Edit Order screen.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.