Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54032

Stop defining core functions included in mobile service in the 'central array'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Web Services
    • Labels:

      Description

      Right now we have two different rules for 'core functions' and 'plugin functions' defined for the mobile service.

      I really dislike this because having two different rules means we have to explain the two ways to developers (or integrators like myself). The core stuff is already defined in core. We should just stop using the functions array in $services, and instead define them as part of the mobile service in their own function definition.

      To try and explain what I mean in core, I would like to do this:

      diff --git a/lib/db/services.php b/lib/db/services.php
      index 566617a..a8610ea 100644
      --- a/lib/db/services.php
      +++ b/lib/db/services.php
      @@ -348,6 +348,7 @@ $functions = array(
               'description' => 'browse moodle files',
               'type'        => 'read',
               'classpath'   => 'files/externallib.php',
      +        'services'     => array(MOODLE_OFFICIAL_MOBILE_SERVICE),
           ),
       
           'moodle_file_upload' => array(
      @@ -1112,7 +1113,6 @@ $services = array(
                   'mod_forum_get_forums_by_courses',
                   'mod_forum_get_forum_discussions_paginated',
                   'mod_forum_get_forum_discussion_posts',
      -            'core_files_get_files',
                   'core_message_get_messages',
                   'core_message_create_contacts',
                   'core_message_delete_contacts',
      

      Until we end up with nothing in that bottom 'central' services array.

      The benefit is then that there aren't two rules for people to learn for how to add a function to the mobile service.. and we won't get mistakes like we already have in that old functions array:

            'enrol_guest_get_instance_info',
                  'enrol_self_enrol_user',
                  'enrol_self_get_instance_info',
                  'gradereport_user_get_grades_table',
                  'gradereport_user_view_grade_report',
                  'message_airnotifier_are_notification_preferences_configured',
                  'message_airnotifier_is_system_configured',
                  ),
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                poltawski Dan Poltawski
                Peer reviewer:
                Dan Poltawski
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Juan Leyva, Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16