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

Conditional availability: Custom user field restriction not selected on form

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Run Behat tests --tags=availability_profile

      or

      0. Ensure you have availability enabled sitewide, and a custom user field (if not, add one).
      1. Edit any activity. Under 'Restrict access', choose 'Add restriction' and select Profile.
      2. Select the custom user field. Make appropriate choices for the other dropdowns, e.g. 'not empty', then save settings.
      3. Edit activity again and expand 'Restrict access'.

      EXPECTED: The settings you made before are still shown.

      Show
      Run Behat tests --tags=availability_profile or 0. Ensure you have availability enabled sitewide, and a custom user field (if not, add one). 1. Edit any activity. Under 'Restrict access', choose 'Add restriction' and select Profile. 2. Select the custom user field. Make appropriate choices for the other dropdowns, e.g. 'not empty', then save settings. 3. Edit activity again and expand 'Restrict access'. EXPECTED: The settings you made before are still shown.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-45478-master

      Description

      When you set a restriction on a custom user field, this works correctly. However if you then edit settings again for the activity (or section), the dropdown with the field name is not correctly set up (it's still in the 'choose a field' state.)

      This applies only to custom fields. I've found the problem and it's a one-character error, but I'm going to add a Behat test anyhow that covers this situation, as it is a UI form problem and since this came up, we might as well have something to verify that the form fields are correctly re-initialised when editing in this case (also to test with custom fields in general as the existing test only uses standard fields).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14