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

Code changes required after moving Moodle site registration data to stats.moodle.org

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.7.1
    • 3.6.7, 3.7.3
    • Hub
    • MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66118-master-byebyemoodlenet
    • Hide

      Testing difficulty

      • Requires access to the sites directory (hub) database to check results of the registration.

      Functionality areas to test

      • Registering a site with the hub
      • Updating the registration manually
      • Updating the registration via a scheduled task
      • Unregistering

      Exploratory testing

      The UI should no longer contain mentions of "Moodle.net"

      Involved DB tables

      You may want to observe the changes in the following tables during the tests:

      SELECT * FROM mdl_registration_hubs;
      SELECT * FROM mdl_config_plugins WHERE plugin = 'hub';
      

      Scenario 1 - fresh installation of the patched site

      1. Install a new site with the patchset applied
      2. Register the site.
      3. TEST Check in the hub that the site has been correctly registered.
      4. Change some registration form settings and update the registration manually.
      5. TEST Check in the hub that the changed settings were updated.
      6. Create some new courses, create more user accounts and enrol them.
      7. Execute the scheduled task \core\task\registration_cron_task
      8. TEST Check in the hub that the number of users, courses and enrolments were updated.
      9. Unregister the site
      10. TEST Check in your hub that the site is marked as unregistered (deleted) and the site itself consider itself not registered.

      Scenario 2 - upgrade of previously registered site

      1. Install a new site to a version without the patchset applied
      2. Register the site. Make sure to provide some custom site description and/or other custom values in the registration form.
      3. TEST Check in your hub that the site has been correctly registered.
      4. Upgrade the site to the patched version.
      5. TEST Check that the site still reports as being registered
      6. TEST Check that the registration form contains your custom settings defined before the upgrade.
      Show
      Testing difficulty Requires access to the sites directory (hub) database to check results of the registration. Functionality areas to test Registering a site with the hub Updating the registration manually Updating the registration via a scheduled task Unregistering Exploratory testing The UI should no longer contain mentions of "Moodle.net" Involved DB tables You may want to observe the changes in the following tables during the tests: SELECT * FROM mdl_registration_hubs; SELECT * FROM mdl_config_plugins WHERE plugin = 'hub'; Scenario 1 - fresh installation of the patched site Install a new site with the patchset applied Register the site. TEST Check in the hub that the site has been correctly registered. Change some registration form settings and update the registration manually. TEST Check in the hub that the changed settings were updated. Create some new courses, create more user accounts and enrol them. Execute the scheduled task \core\task\registration_cron_task TEST Check in the hub that the number of users, courses and enrolments were updated. Unregister the site TEST Check in your hub that the site is marked as unregistered (deleted) and the site itself consider itself not registered. Scenario 2 - upgrade of previously registered site Install a new site to a version without the patchset applied Register the site. Make sure to provide some custom site description and/or other custom values in the registration form. TEST Check in your hub that the site has been correctly registered. Upgrade the site to the patched version. TEST Check that the site still reports as being registered TEST Check that the registration form contains your custom settings defined before the upgrade.

    Description

      Moodle site registration data is being moved from moodle.net to stats.moodle.org (MDLSITE-5894). As a result, changes are required in core code.

      Note: MDLSITE-5894 needs to be completed before this issue is integrated.

      As commented by Marina in MDLSITE-5861:

      1. There is one place in core where we store a constant with the "hub" name https://github.com/moodle/moodle/blob/master/lib/moodlelib.php#L498

       
      define('HUB_MOODLEORGHUBURL', "https://moodle.net");
      define('HUB_OLDMOODLEORGHUBURL', "http://hub.moodle.org");
      

       
      2. There was an upgrade script once changing references to http://hub.moodle.org -> https://moodle.net for sites that were already registered. If we change the value of this variable we will need to repeat it:
      https://github.com/moodle/moodle/blob/master/lib/db/upgrade.php#L793-L818
      Note that there are config variables that contain the hub name (from the time when it was possible to register on multiple hubs)

      (3. removed as it has been done.)

      4. There are couple of hardcoded "Moodle.net" strings in core that need to be changed in core, just search the code for them.
      one of the examples: https://github.com/moodle/moodle/blob/master/admin/registration/renewregistration.php#L59

      5. There are the following "endpoints" on both https://moodle.net and http://hub.moodle.org that code accesses and that should continue to work with the current URLs:
      /local/hub/webservice/webservices.php
      /local/hub/webservice/download.php
      /local/hub/webservice/upload.php
      /local/hub/siteregistration.php
      /privacy
      Important: the redirection should also redirect POST content, not only GET

      Attachments

        Issue Links

          Activity

            People

              mudrd8mz David Mudrák (@mudrd8mz)
              tsala Helen Foster
              Marina Glancy Marina Glancy
              Andrew Lyons Andrew Lyons
              Andrew Lyons Andrew Lyons
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Nov/19

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 1 day, 1 hour, 30 minutes
                  1w 1d 1h 30m