MDL-29471 php warning when adding function to a new web service
authorJerome Mouneyrac <jerome@moodle.com>
Fri, 27 Jan 2012 08:10:05 +0000 (16:10 +0800)
committerJerome Mouneyrac <jerome@moodle.com>
Fri, 27 Jan 2012 08:10:05 +0000 (16:10 +0800)
admin/webservice/forms.php
admin/webservice/service_functions.php

index dab9a42..5185b9b 100644 (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');
index d4f7da8..fc0e886 100644 (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