Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#7 | ubercart-2.x-dev-credit-title-callback.patch | 1.02 KB | arpieb |
Comments
Comment #1
sah62 CreditAttribution: sah62 commentedOK, I found the function in uc_credit.admin.inc:
What might cause it to not be found?
Comment #2
longwaveWhat are you doing to cause that error to be logged?
Comment #3
sah62 CreditAttribution: sah62 commentedI 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.
Comment #4
sah62 CreditAttribution: sah62 commentedSorry, forgot to reset the status back to "active" after providing the requested information.
Comment #5
virtuali1151 CreditAttribution: virtuali1151 commentedI 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.
Comment #6
virtuali1151 CreditAttribution: virtuali1151 commentedThe payments seems to still go through ok.. but the error still occurs.
Comment #7
arpieb CreditAttribution: arpieb commentedThis is a patch against the Mar 1, 2011 6.x-2.x-dev codebase versioned as follows:
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.
Comment #8
longwaveComment #9
sah62 CreditAttribution: sah62 commentedThe patch works fine for me - thanks!
Comment #10
longwaveCommitted to both branches, thanks for the patch.