Current code is:

function uc_worldpay_menu($may_cache) {
  if ($may_cache) {
    $items[] = array(
      'path' => 'cart/worldpay/complete',
      'title' => t('Order complete'),
      'callback' => 'uc_worldpay_complete',
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
    );
  }

  return $items;
}

Should be:

function uc_worldpay_menu() {
  $items['cart/worldpay/complete'] = array(
    'title' => 'Order complete',
    'page callback' => 'uc_worldpay_complete',
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}

Comments

jamestombs’s picture

Title: hook_menu() in D6 module is D5 code not D6 » Alot of the hooks are using D5 hooks rather than D6
Priority: Normal » Major

Just noticed that the hook_form_alter() code is wrong too.

It is:

function uc_worldpay_form_alter($form_id, &$form) {
  if ($form_id == 'uc_cart_checkout_review_form' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
    $order = uc_order_load($order_id);

    if ($order->payment_method == 'worldpay') {
      unset($form['submit']);
      $form['#prefix'] = '<table style="display: inline; padding-top: 1em;"><tr><td>';
      $form['#suffix'] = '</td><td>'. drupal_get_form('uc_worldpay_form', $order) .'</td></tr></table>';
    }
  }
}

Should be:

function uc_worldpay_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'uc_cart_checkout_review_form' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
    $order = uc_order_load($order_id);

    if ($order->payment_method == 'worldpay') {
      unset($form['submit']);
      $form['#prefix'] = '<table style="display: inline; padding-top: 1em;"><tr><td>';
      $form['#suffix'] = '</td><td>'. drupal_get_form('uc_worldpay_form', $order) .'</td></tr></table>';
    }
  }
}

In fact it looks like the completely wrong file has been uploaded for 6.x-1.dev

gruberroland’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

Seems to be already fixed