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

Site Registration: Recognise cloned or moved sites

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_405_STABLE, MOODLE_500_STABLE
    • MOODLE_405_STABLE, MOODLE_500_STABLE
    • MDL-83448-405
    • MDL-83448-500
    • MDL-83448-main
    • Hide

      Setup

      We will be registering these sites at Moodle's official stats.moodle.org site.

      We need the following:

      1. A publicly accessible site (use Ngrok or other tunnelling service)
      2. Two unique site URLs (to mimic a cloned/moved site)

      Ngrok's free service randomly generates a URL each time it is run, which is perfect for this test. Other tunnelling services may provide a similar feature.

      Testing public sites

      1. Update your config wwwroot with your first public URL
      2. Log in as admin
      3. Go to Site admin > Registration
      4. Fill out all the required inputs
      5. Check the "Privacy notice and data processing agreement"
      6. Click on "Register your site"
      7. Verify that you were taken to "Site registration confirmed" page
      8. Click on "Continue" button
      9. Verify that you have a notification alert saying your site has been registered.
      10. Go to the bottom page and
      11. Verify that now you see "Update registration" button and "Unregister" link underneath the "Required" label.
      12. Change your site to use another public URL (update wwwroot in config too)
      13. Go back to Site admin > Registration and refresh the page
      14. Verify that you now see a red notification alert saying "Don't miss out on important updates and security alerts."
      15. Go to the bottom of the page and
      16. Verify that you now see "Register your site"
      17. Click on "Register your site" again
      18. Verify that you have a notification alert saying your site has been registered.

      Testing private site new install or site upgrade

      1. Create a fresh install of Moodle
      2. Please add the following code in your config.php

        $CFG->site_is_public = false;

      3. Log in as admin
      4. Click on "Site administration" once you're redirected to your home page
      5. Verify that you were not redirected to the site registration page
      6. Verify that there is no notification prompting you to register your site (see below)
      Show
      Setup We will be registering these sites at Moodle's official stats.moodle.org site. We need the following: A publicly accessible site (use Ngrok or other tunnelling service) Two unique site URLs (to mimic a cloned/moved site) Ngrok's free service randomly generates a URL each time it is run, which is perfect for this test. Other tunnelling services may provide a similar feature. Testing public sites Update your config wwwroot with your first public URL Log in as admin Go to Site admin > Registration Fill out all the required inputs Check the "Privacy notice and data processing agreement" Click on "Register your site" Verify that you were taken to "Site registration confirmed" page Click on "Continue" button Verify that you have a notification alert saying your site has been registered. Go to the bottom page and Verify that now you see "Update registration" button and "Unregister" link underneath the "Required" label. Change your site to use another public URL (update wwwroot in config too) Go back to Site admin > Registration and refresh the page Verify that you now see a red notification alert saying "Don't miss out on important updates and security alerts." Go to the bottom of the page and Verify that you now see "Register your site" Click on "Register your site" again Verify that you have a notification alert saying your site has been registered. Testing private site new install or site upgrade Create a fresh install of Moodle Please add the following code in your config.php $CFG ->site_is_public = false; Log in as admin Click on "Site administration" once you're redirected to your home page Verify that you were not redirected to the site registration page Verify that there is no notification prompting you to register your site (see below)
    • Hide

      Code verified against automated checks.

      Checked MDL-83448 using repository: https://github.com/stevandoMoodle/moodle.git

      More information about this report

      Built on: Tue Mar 18 05:18:20 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-83448 using repository: https://github.com/stevandoMoodle/moodle.git MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-83448-404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-83448-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-83448-main | CI Job ] More information about this report Built on: Tue Mar 18 05:18:20 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-83448-405

      Launching automatic jobs for branch MDL-83448-500

      Launching automatic jobs for branch MDL-83448-main

      Built on: Fri May 23 03:56:34 UTC 2025

      Show
      Launching automatic jobs for branch MDL-83448 -405 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19433/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66453/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66454/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66455/ Behat (Firefox - classic / complete) Launching automatic jobs for branch MDL-83448 -500 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19434/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66456/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66457/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66458/ Behat (Firefox - classic / complete) Launching automatic jobs for branch MDL-83448 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/19435/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66459/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66460/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66461/ Behat (Firefox - classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/66462/ App tests (stable app version) / complete) Built on: Fri May 23 03:56:34 UTC 2025
    • 6
    • Team Dragons 2025 Sprint 1.2, Team Dragons 2025 Sprint 1.3, Team Hedgehogs 2025 Sprint 2.0, Team Hedgehogs 2025 Sprint 2.1

      It is common practice to:

      • Clone/copy a production site to a staging or non-production site, for testing etc.
      • Promote by copy/clone a staging site to production

      In both cases these sites will have the same data (DB and filedir) but will have a different URL.  Also the production site could be registered.

      Currently, it appears that the registration process does not recognise the cloned site as being different from the original site. In cases where the original site is registered.

      This leads to a workflow where the options are to update the registration of the cloned site, or unregister the source site.

      Instead, the options should be to register the cloned site or skip registration. Which is the same workflow for a newly installed or unregistered upgraded site.

      In the less common case where a production site has changed URL's, it isn't necessary to explicitly accommodate this workflow. If the site is registered (as a new site) the admin still gets the benefit of registration. The registration database will mark the original URL as an unreachable site after a period of time and the new registration data from the site will be added to the database. So there is not net difference.

      In cases where a non production site is constantly/regularly updated from production. To save the non production site from displaying a registration prompt, admins have the existing option to set: `$CFG->site_is_public = false;` in the config.php file.

            stevani.andolo@moodle.com Stevani Andolo
            matt.porritt@moodle.com Matt Porritt
            Victor Déniz Falcón Victor Déniz Falcón
            David Woloszyn David Woloszyn
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            2 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 6 hours, 22 minutes
                1w 6h 22m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.