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

Add a $CFG setting to define the preset to be installed

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-73145-master
    • Hide

      IMPORTANT: As all these installations will be run against the same code and database, it's important to use a different dbprefix. The testing instructions have been written taking this into account (so this is just a warning in case you copy&paste the command without changing this value).

      Testing scenario 1. CLI install: Apply STARTER

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=aa_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=starter --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors.
      3. Open the config.php and check it contains $CFG->setsitepresetduringinstall = 'starter'.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check the "Show version history" option is displayed in the "Starter" actions menu.
      7. Go to "Site administration > Advanced features".
      8. Check "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are disabled.
      9. Go to "Site administration > Plugins > Manage activities".
      10. Check, at least, Chat, Database and Lesson are disabled.

      Testing scenario 2. CLI install: Apply a non-existing preset

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=bb_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=unexisting --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors.
      3. Open the config.php and check it contains $CFG->setsitepresetduringinstall = 'unexisting'.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check the "Show version history" option is NOT displayed in the "Starter" actions menu.
      7. Go to "Site administration > Advanced features".
      8. Check all the settings have their default value.
      9. Go to "Site administration > Plugins > Manage activities".
      10. Check Chat, Database and Lesson are enabled.

      Testing scenario 3. CLI install: Import valid XML file

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=cc_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/import_settings_plugins.xml --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors.
      3. Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/import_settings_plugins.xml'.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check a 3 presets are displayed: "Starter", "Full" and "Imported preset".
      7. Check the "Show version history" option is displayed in the "Imported preset" actions menu.
      8. Go to "Site administration > Plugins > Manage activities".
      9. Check, Chat and Database are disabled and Lesson is enabled.

      Testing scenario 4. CLI install: Import unexisting XML file

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=dd_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/xxxxx.xml --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors (there are some warnings, but no errors).
      3. Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/xxxxx.xml'.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check only 2 presets are displayed: "Starter" and "Full".
      7. Go to "Site administration > Plugins > Manage activities".
      8. Check, Chat, Database and Lesson are enabled. 

      Testing scenario 5. CLI install: Import invalid XML file

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=ee_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/invalid_xml_file.xml --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors.
      3. Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/invalid_xml_file.xml'.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check only 2 presets are displayed: "Starter" and "Full".
      7. Go to "Site administration > Plugins > Manage activities".
      8. Check, Chat, Database and Lesson are enabled. 

      Testing scenario 6. CLI install: Default installation (without --sitepreset)

      1. Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation:

        sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http://localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=ff_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --agree-license --non-interactive --allow-unstable

      2. Check the installation process finishes without errors.
      3. Open the config.php and check it does NOT contain $CFG->setsitepresetduringinstall.
      4. Login as admin.
      5. Go to "Site administration > Site admin presets".
      6. Check the "Show version history" option is not displayed in the "Starter" nor the "Full" actions menu.
      7. Go to "Site administration > Advanced features".
      8. Check "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are enabled.
      9. Go to "Site administration > Plugins > Manage activities".
      10. Check, at least, Chat, Database and Lesson are enabled.

      Testing scenario 7. Manual install: Apply STARTER

      1.  Edit the config.php file and change the following fields:
        • $CFG->prefix = 'gg_';
        • $CFG->setsitepresetduringinstall = 'starter';
      2. Go to the Moodle site and follow the installation process, pressing the "Continue" button, to installing manually your Moodle site.
      3. Once the installation process finishes and all the required forms are filled-out, go to "Site administration > Site admin presets".
      4. Check the "Show version history" option is displayed in the "Starter" actions menu.
      5. Go to "Site administration > Advanced features".
      6. Check "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are disabled.
      7. Go to "Site administration > Plugins > Manage activities".
      8. Check, at least, Chat, Database and Lesson are disabled.
      Show
      IMPORTANT : As all these installations will be run against the same code and database, it's important to use a different dbprefix. The testing instructions have been written taking this into account (so this is just a warning in case you copy&paste the command without changing this value). Testing scenario 1. CLI install: Apply STARTER Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=aa_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=starter --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors. Open the config.php and check it contains $CFG->setsitepresetduringinstall = 'starter'. Login as admin. Go to "Site administration > Site admin presets". Check the "Show version history" option is displayed in the "Starter" actions menu. Go to "Site administration > Advanced features". Check  "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are disabled. Go to "Site administration > Plugins > Manage activities". Check , at least, Chat, Database and Lesson are disabled. Testing scenario 2. CLI install: Apply a non-existing preset Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=bb_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=unexisting --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors. Open the config.php and check it contains $CFG->setsitepresetduringinstall = 'unexisting'. Login as admin. Go to "Site administration > Site admin presets". Check the "Show version history" option is NOT displayed in the "Starter" actions menu. Go to "Site administration > Advanced features". Check  all the settings have their default value. Go to "Site administration > Plugins > Manage activities". Check  Chat, Database and Lesson are enabled. Testing scenario 3. CLI install: Import valid XML file Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=cc_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/import_settings_plugins.xml --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors. Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/import_settings_plugins.xml'. Login as admin. Go to "Site administration > Site admin presets". Check a 3 presets are displayed: "Starter", "Full" and "Imported preset". Check the "Show version history" option is displayed in the "Imported preset" actions menu. Go to "Site administration > Plugins > Manage activities". Check , Chat and Database are disabled and Lesson is enabled. Testing scenario 4. CLI install: Import unexisting XML file Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=dd_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/xxxxx.xml --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors (there are some warnings, but no errors). Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/xxxxx.xml'. Login as admin. Go to "Site administration > Site admin presets". Check only 2 presets are displayed: "Starter" and "Full". Go to "Site administration > Plugins > Manage activities". Check , Chat, Database and Lesson are enabled.  Testing scenario 5. CLI install: Import invalid XML file Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=ee_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --sitepreset=../tool/admin_presets/tests/fixtures/invalid_xml_file.xml --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors. Open the config.php and check it contains $CFG->setsitepresetduringinstall = '../tool/admin_presets/tests/fixtures/invalid_xml_file.xml'. Login as admin. Go to "Site administration > Site admin presets". Check only 2 presets are displayed: "Starter" and "Full". Go to "Site administration > Plugins > Manage activities". Check , Chat, Database and Lesson are enabled.  Testing scenario 6. CLI install: Default installation (without --sitepreset) Open a terminal and run the following command. You'll probably need to modify some values, such as wwwroot, dbname, dbuser and dbpass to your local installation: sudo -u www-data php admin/cli/install.php --lang=en --wwwroot=http: //localhost/m/integration_master --dbtype=pgsql --dbname=integrationmaster --dbuser=postgres --dbpass=postgres --prefix=ff_ --fullname=Test --shortname=Test --adminpass=test --adminemail=admin@moodle.invalid --agree-license --non-interactive --allow-unstable Check the installation process finishes without errors. Open the config.php and check it does NOT contain $CFG->setsitepresetduringinstall. Login as admin. Go to "Site administration > Site admin presets". Check the "Show version history" option is not displayed in the "Starter" nor the "Full" actions menu. Go to "Site administration > Advanced features". Check  "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are enabled. Go to "Site administration > Plugins > Manage activities". Check , at least, Chat, Database and Lesson are enabled. Testing scenario 7. Manual install: Apply STARTER  Edit the config.php file and change the following fields: $CFG->prefix = 'gg_'; $CFG->setsitepresetduringinstall = 'starter'; Go to the Moodle site and follow the installation process, pressing the "Continue" button, to installing manually your Moodle site. Once the installation process finishes and all the required forms are filled-out, go to "Site administration > Site admin presets". Check the "Show version history" option is displayed in the "Starter" actions menu. Go to "Site administration > Advanced features". Check  "Enable comments", "Enable tags functionality", "Enable notes", "Enable blogs", "Enable badges" and "Enable competencies" features are disabled. Go to "Site administration > Plugins > Manage activities". Check , at least, Chat, Database and Lesson are disabled.
    • Moppies Kanban

    Description

      Add a mechanism, such as a setting $CFG in the config.php file, to let admins define the preset to be installed by default when the installer will be executed.

      Attachments

        1. MDL-73145_test 1_1.png
          MDL-73145_test 1_1.png
          51 kB
        2. MDL-73145_test 1_2.png
          MDL-73145_test 1_2.png
          94 kB
        3. MDL-73145_test 1_3.webm
          1.92 MB
        4. MDL-73145_test 2_1.png
          MDL-73145_test 2_1.png
          55 kB
        5. MDL-73145_test 2_2.png
          MDL-73145_test 2_2.png
          94 kB
        6. MDL-73145_test 2_3.webm
          2.11 MB
        7. MDL-73145_test 3_1.png
          MDL-73145_test 3_1.png
          53 kB
        8. MDL-73145_test 3_2.png
          MDL-73145_test 3_2.png
          97 kB
        9. MDL-73145_test 3_3.webm
          766 kB
        10. MDL-73145_test 4_1.png
          MDL-73145_test 4_1.png
          63 kB
        11. MDL-73145_test 4_2.png
          MDL-73145_test 4_2.png
          98 kB
        12. MDL-73145_test 4_3.webm
          669 kB
        13. MDL-73145_test 5_1.png
          MDL-73145_test 5_1.png
          113 kB
        14. MDL-73145_test 5_2.png
          MDL-73145_test 5_2.png
          99 kB
        15. MDL-73145_test 5_3.webm
          677 kB
        16. MDL-73145_test 6_1.png
          MDL-73145_test 6_1.png
          60 kB
        17. MDL-73145_test 6_2.png
          MDL-73145_test 6_2.png
          89 kB
        18. MDL-73145_test 6_3.webm
          2.11 MB
        19. MDL-73145_test 7_3.webm
          2.56 MB

        Issue Links

          Activity

            People

              sarjona Sara Arjona (@sarjona)
              sarjona Sara Arjona (@sarjona)
              Amaia Anabitarte Amaia Anabitarte
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Angelia Dela Cruz Angelia Dela Cruz
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 40 minutes
                  1d 1h 40m