MDL-29471 php warning when adding function to a new web service

This commit is contained in:
Jerome Mouneyrac 2012-01-27 16:10:05 +08:00
parent 216f6d8e9d
commit e1cf6b4be2
2 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ class external_service_functions_form extends moodleform {
$functions[$functionid] = $function->name . ':' . $function->description;
}
$mform->addElement('searchableselector', 'fid', get_string('name'),
$mform->addElement('searchableselector', 'fids', get_string('name'),
$functions, array('multiple'));
$mform->addElement('hidden', 'id');

View File

@ -67,7 +67,7 @@ switch ($action) {
//add the function to the service then redirect to function list page
if ($data = $mform->get_data()) {
ignore_user_abort(true); // no interruption here!
foreach ($data->fid as $fid) {
foreach ($data->fids as $fid) {
$function = $webservicemanager->get_external_function_by_id(
$fid, MUST_EXIST);
// make sure the function is not there yet