Skip to content

Commit

Permalink
MDL-38821 enrol_paypal: fix cost param type
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 2, 2013
1 parent 6842ab4 commit 881afa4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions enrol/paypal/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

$instance->status = $data->status;
$instance->name = $data->name;
$instance->cost = $data->cost;
$instance->cost = unformat_float($data->cost);
$instance->currency = $data->currency;
$instance->roleid = $data->roleid;
$instance->enrolperiod = $data->enrolperiod;
Expand All @@ -83,7 +83,7 @@
}

} else {
$fields = array('status'=>$data->status, 'name'=>$data->name, 'cost'=>$data->cost, 'currency'=>$data->currency, 'roleid'=>$data->roleid,
$fields = array('status'=>$data->status, 'name'=>$data->name, 'cost'=>unformat_float($data->cost), 'currency'=>$data->currency, 'roleid'=>$data->roleid,
'enrolperiod'=>$data->enrolperiod, 'enrolstartdate'=>$data->enrolstartdate, 'enrolenddate'=>$data->enrolenddate);
$plugin->add_instance($course, $fields);
}
Expand Down
2 changes: 1 addition & 1 deletion enrol/paypal/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function definition() {
$mform->setDefault('status', $plugin->get_config('status'));

$mform->addElement('text', 'cost', get_string('cost', 'enrol_paypal'), array('size'=>4));
$mform->setType('cost', PARAM_TEXT);
$mform->setType('cost', PARAM_RAW); // Use unformat_float to get real value.
$mform->setDefault('cost', $plugin->get_config('cost'));

$paypalcurrencies = $plugin->get_currencies();
Expand Down

0 comments on commit 881afa4

Please sign in to comment.