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

moodle_database::get_in_or_equal() does not accept empty arrays adding a webservice / no authorized user by default

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.0.4, 4.0.5, 4.1
    • 4.0.6, 4.1.1
    • Web Services
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-76284-400
    • MDL-76284-401
    • Hide
      1. Log in as admin
      2. Create a new user
      3. Navigate to Advanced features in site administration
      4. Tick Enable web services and save changes
      5. Navigate to Server > Web services > External services in site administration
      6. Add a new custom service
        • Name: Cool
        • Authorised users only [ Yes ]
      7. After creation, press Add functions
      8. Add the following function:

        core_calendar_update_event_start_day
        

      9. Navigate back to External services
      10. Press Authorised users for your Cool service
      11. Confirm there is no exception shown on the page
      12. Select your new user from Not authorised users in press Add
      13. Confirm missing capabilities are shown for the new user
      Show
      Log in as admin Create a new user Navigate to Advanced features in site administration Tick Enable web services and save changes Navigate to Server > Web services > External services in site administration Add a new custom service Name: Cool Authorised users only [ Yes ] After creation, press Add functions Add the following function: core_calendar_update_event_start_day Navigate back to External services Press Authorised users for your Cool service Confirm there is no exception shown on the page Select your new user from Not authorised users in press Add Confirm missing capabilities are shown for the new user

    Description

      Trying to add a service with restrictedusers parameter set to 0 (or not at all), will throw an error as no authorized user can be set by default. Services and functions can by default in plugin/db/services.php,  users cannot be.

      It seems that either the lib/upgradelib.php  external_update_descriptions method should be improved to include the addition of default authorized users or get_in_or_equal call should be passed a fifth option in webservice/lib.php to avoid throwing errors.

      Attachments

        Activity

          People

            pholden Paul Holden
            marcalexandreghaly Marc-Alexandre GHALY
            Raquel Ortega Raquel Ortega
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              16/Jan/23

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 52 minutes
                1h 52m