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

Setting allcountrycodes blocks upgrade and should not impact displaying of an existing country code

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Follow the steps to reproduce in the issue description.
      2. Confirm you see the expected behaviour now.

      Please note this should be tested on both 3.3 and 3.4 / 3.5 as the patch is slightly different (due to changes in the implementation of the course participants page).

      Show
      Follow the steps to reproduce in the issue description. Confirm you see the expected behaviour now. Please note this should be tested on both 3.3 and 3.4 / 3.5 as the patch is slightly different (due to changes in the implementation of the course participants page).
    • Workaround:
      Hide

      Do not set $CFG->allcountrycodes

      Show
      Do not set $CFG->allcountrycodes
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61658-master-allcountrycodes

      Description

      Problem

      The site setting "All country codes" (allcountrycodes) should contain "list of countries that may be selected in various places" In other words, it should affect only drop down menus where the user selects the country from. However, the field value also affects some places where we display an existing country value.

      The second (and more important) problem is that the setting set blocks upgrades to latest stable version as the field digital age of consent does not validate. Typical message is something like `The digital age of consent is not valid: "AT" is not a valid value for country.`

      Steps to reproduce

      • Prepare a site where users have different countries set in their profiles (mdk does that for you)
      • Prepare a course and enrol all those users to it (mdk can that for you, too)
      • Set "All country codes" (allcountrycodes) so just a single value, e.g. "CZ"
      • Set "Show user identity (showuseridentity) to include the user's country (does not apply on 3.3)
      • Log in as admin and visit Site administration > Users> Accounts> Browse list of users
        • Expected behaviour: All countries should be displayed with their name
        • Actual behaviour: Countries not in allcountrycodes are displayed as the codes only
      • Stay logged in as admin, or log in as a teacher and visit your course's Participants page
        • Expected behaviour: All countries should be displayed with their name
        • Actual behaviour: Countries not in allcountrycodes are not displayed at all. In Moodle 3.3, PHP notices are thrown like "Notice: Undefined index: BR in .../user/index.php on line 753"
      • Add a block "Logged in user" and make sure it is configured to show the user's country, too.
        • Expected behaviour: The user's country should be always displayed
        • Actual behaviour: The user's country is not displayed unless it is on the allcountrycodes whitelist
      • As an admin try to save the field "Digital age of consent (agedigitalconsentmap)" with its default value.
        • Expected behaviour: The field can be saved
        • Actual behaviour: The field is not validated as it contains countries not whitelisted in allcountrycodes

        Attachments

        1. Expected behavior1.PNG
          Expected behavior1.PNG
          76 kB
        2. Expected behavior2.PNG
          Expected behavior2.PNG
          70 kB
        3. Expected behavior3.PNG
          Expected behavior3.PNG
          10 kB
        4. Expected behavior4.PNG
          Expected behavior4.PNG
          24 kB
        5. screenshot-1.png
          screenshot-1.png
          91 kB
        6. screenshot-2.png
          screenshot-2.png
          59 kB

          Issue Links

            Activity

              People

              • Assignee:
                mudrd8mz David Mudrák (@mudrd8mz)
                Reporter:
                mudrd8mz David Mudrák (@mudrd8mz)
                Peer reviewer:
                Sara Arjona (@sarjona)
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Gladys Basiana
                Participants:
                Component watchers:
                cameron1729, David Mudrák (@mudrd8mz), Helen Foster, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18

                  Time Tracking

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