Line 286 in pay.inc drupal_write_record($this->table, $this, $update); saves the settings and the handler to the table but not the "Title" and "Description"

This is on a vanilla drupal 6.22 with pay, webform_pay and my own sagepay_direct installed.

CommentFileSizeAuthor
#5 pay-inc.patch2.02 KBpaul.dambra

Comments

paul.dambra’s picture

So when you add a payment method it shows in the list with a blank label.

Clicking edit on that added method displays a form without saved values.

Filling in and saving that form duplicates the entry (although I didn't enter identical values so...)

paul.dambra’s picture

$values as passed to save in pay.inc =>
... (Array, 19 elements)
pay_method_gateway_sagepay_direct (Array, 13 elements)
op (String, 11 characters ) Save values
submit (String, 11 characters ) Save values
form_build_id (String, 37 characters ) form-b86f272f149c0ec2b2ba392a2eaa1a2e
form_token (String, 32 characters ) a39c557af29dd1c533ba840b5e22537b
form_id (String, 21 characters ) pay_admin_method_form | (Callback) pay_admin_method_form();
title (String, 4 characters ) test
description (String, 4 characters ) test
min_amount (String, 0 characters )
max_amount (String, 0 characters )
pay_form_action (String, 8 characters ) complete
permissions (Array, 1 element)
payment_types (Array, 9 elements)
gateway_testmode (Integer) 1
sagepay_vendorname (String, 4 characters ) test
sagepay_vendor_tx_code_prefix (String, 4 characters ) test
sagepay_system (String, 10 characters ) SIMULATION
sagepay_currency (String, 3 characters ) GBP
sagepay_tx_type (String, 7 characters ) PAYMENT
Krumo version 0.2a | http://krumo.sourceforge.net Called from C:\Programming\drupal-6.22\sites\all\modules\contrib\pay\includes\handlers\pay.inc, line 268

paul.dambra’s picture

you can see here title and description aren't carried in via __construct($values)

after running __construct($vales) =>
... (Object) pay_method_gateway_sagepay_direct
SagePayRequest (Object) SagePayVspDirectPost
payment_types (Array, 0 elements)
gateway_testmode (Boolean) TRUE
gateway_supports_ach (Boolean) FALSE
gateway_supports_cc (Boolean) TRUE
gateway_supports_recurring (Boolean) FALSE
payment_type (NULL)
cc_type (NULL)
cc_number (NULL)
cc_ccv2 (NULL)
cc_exp_month (NULL)
cc_exp_year (NULL)
cc_issue_number (NULL)
pmid (NULL)
title (NULL)
description (NULL)
min_amount (NULL)
max_amount (NULL)
pay_form_action (String, 8 characters ) complete
total (NULL)
status (Integer) 1
first_name (NULL)
last_name (NULL)
mail (NULL)
billto (Array, 0 elements)
table (String, 10 characters ) pay_method
key (String, 4 characters ) pmid
permissions (Array, 1 element)
handler (String, 33 characters ) pay_method_gateway_sagepay_direct
form_values (Array, 19 elements)
Krumo version 0.2a | http://krumo.sourceforge.net Called from C:\Programming\drupal-6.22\sites\all\modules\contrib\pay\includes\handlers\pay.inc, line 270

paul.dambra’s picture

This is because there are no set_title and set_description methods.

paul.dambra’s picture

StatusFileSize
new2.02 KB

Am relatively new to OO php but the call to $this->__construct($values) in function save was confusing me as it didn't seem to populate the values. As a result I've added set_values method that is called from the constructor and from the save method.

This now saves the title and description to the database.

the admin page doesn't display them but I'll look at that next.

I've attached my patch for the pay.inc file

paul.dambra’s picture

Status: Active » Closed (works as designed)

and now I've followed it all the way through it was my module at fault... apologies and facepalm