Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Payment
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2013 at 21:40 UTC
Updated:
29 May 2013 at 18:41 UTC
Hello Guys, i've this error when using PagosOnline for Ubercart:
Notice: Undefined variable: null in uc_payment_method_settings_form() (line 109 of C:\xampp\htdocs\tienda_demo_ubercart_d7\sites\all\modules\ubercart\payment\uc_payment\uc_payment.admin.inc).
This was my Step by Step:
What can it be?
Thanks for your help!
| Comment | File | Size | Author |
|---|---|---|---|
| Pagosonline settings_192.168.1.254_20130512-163923.png | 15.68 KB | dvasquez |
Comments
Comment #1
DanZ commentedThis looks like an error in the code that generates the config form for PagosOnline.
You have already reported this in the PagosOnline queue at #1991586: Undefined variable: null en uc_payment_method_settings_form() línea 109 de uc_payment.admin.inc, which is the right thing to do.
This is not an Ubercart problem. You may wish to install the Devel module and examine a Krumos backtrace to troubleshoot this more.
Comment #2
DanZ commentedOn a closer look, I've decided that I'm wrong. This is an Ubercart bug.
Note the variable $null. It's not initialized. This function could never work right. I don't know why it didn't blow up for lots of other payment methods.
Maybe it has something to do with this: Elsewhere in the file, there is the following function:
I don't understand the point of assigning NULL to a variable, instead of just using NULL.... Try changing that $null to NULL and see if that helps.
Comment #3
dvasquez commentedIt´s working for me!
Thanks man!
Comment #4
DanZ commentedNo patch to review, yet.
Comment #5
longwaveFixed in http://drupalcode.org/project/ubercart.git/commitdiff/fa7e8d0
$null = NULL;is necessary here because the second parameter of the payment method callback is expected to be a reference by some payment methods. Passing a plain NULL here results in an error when using the settings link on several other payment methods such as PayPal. That doesn't explain why the undefined variable doesn't show when using other core-provided payment methods (can you pass undeclared variables by reference in PHP?!), but the committed fix should work for all cases.Comment #6
longwaveComment #7
dvasquez commented@longwave, you're right about that. I think the best way is re-declarate the variable into uc_payment_method_settings_form function, some like this:
It works for me...
Comment #8
tr commentedComment #9
tr commentedComment #10
DanZ commented@dvasquez: He did. See http://drupalcode.org/project/ubercart.git/commitdiff/fa7e8d0.
Comment #11
dvasquez commented@DanZ, i see... Well, it's working with COD, PagosOnline, 2Checkout, Google Checkout, Check, PayPal Express Checkout, PayPal Website Payments Standard.
No error, Good Work!