I'm just starting to work with credit card payments and I saw this error in my log:

call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'uc_credit_terminal_title' was given in /home/somedir/public_html/includes/menu.inc on line 507.

I can see where tuc_credit_terminal_title is referenced on line 51 of uc_credit.module, but it doesn't appear to be defined anywhere - it's not in uc_credit.module or uc_credit.pages.inc. Am I missing something or is it really missing?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sah62’s picture

OK, I found the function in uc_credit.admin.inc:

/**
 * Title callback for admin/store/orders/%uc_order/credit.
 */
function uc_credit_terminal_title($order) {
  return t('Credit card terminal: Order @order_id', array('@order_id' => $order->order_id));
}

What might cause it to not be found?

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

What are you doing to cause that error to be logged?

sah62’s picture

I start by viewing an order that was paid for using a credit card. I then click on the "Process card" button that appears in the Payment box. That takes me to "https://www.mydomain.com/admin/store/orders/num/credit" (referrer is https://www.mydomain.com/admin/store/orders/num), and the error is logged.

sah62’s picture

Status: Postponed (maintainer needs more info) » Active

Sorry, forgot to reset the status back to "active" after providing the requested information.

virtuali1151’s picture

I am also getting the same error when viewing the process card as well.

call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'uc_credit_terminal_title' was given in /home/site/public_html/includes/menu.inc on line 507.

virtuali1151’s picture

The payments seems to still go through ok.. but the error still occurs.

arpieb’s picture

Status: Active » Patch (to be ported)
FileSize
1.02 KB

This is a patch against the Mar 1, 2011 6.x-2.x-dev codebase versioned as follows:

; Information added by drupal.org packaging script on 2011-02-25
version = "6.x-2.x-dev"
core = "6.x"
project = "ubercart"
datestamp = "1298620468"

Turns out that a title callback needs to be in the same module file as the hook_menu implementation or else it will fail (which is what we're seeing). The existing code assumes that the page callback file is loaded prior to the title callback being invoked, which is not the case. This patch simply relocates that function from payment/uc_credit/uc_credit.admin.inc to a new home in payment/uc_credit/uc_credit.module.

longwave’s picture

Status: Patch (to be ported) » Needs review
sah62’s picture

The patch works fine for me - thanks!

longwave’s picture

Status: Needs review » Fixed

Committed to both branches, thanks for the patch.

Status: Fixed » Closed (fixed)

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