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

Implicit validation of the the filetypes form element

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide
      1. Run Behat test for the feature file lib/form/tests/behat/filetypes.feature.
      2. Copy the attached test-filetypes-form.php into the root of your Moodle 3.4 installation
      3. Test that the input fields are validated against the set options, both when the types are selected via the JS widget or typed in manually.
      Show
      Run Behat test for the feature file lib/form/tests/behat/filetypes.feature . Copy the attached test-filetypes-form.php into the root of your Moodle 3.4 installation Test that the input fields are validated against the set options, both when the types are selected via the JS widget or typed in manually.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59443-master-filetypesvalidation
    • Sprint:
      3.4 Sprint 2

      Description

      In MDL-53240 a new form element "filetypes" was introduced and we just started working on issues that make use of it (MDL-59299, MDL-56486).

      The new form element comes with a util helper class that helps to detect unknown file types:
      core_form\filetypes_util::get_unknown_file_types(). It was presumed that each form using this new element would perform its own validation and inform the user about unknown file types.

      In the stable team discussions, it was suggested that the form element could ship with an implicit validation rule to check that all submitted values represent a valid file type. So that the element consumers would not need to do it.

      This issue is to track the implementation of such an implicit validation rule.

        Attachments

        1. screenshot-1.png
          screenshot-1.png
          35 kB
        2. screenshot-2.png
          screenshot-2.png
          24 kB
        3. screenshot-3.png
          screenshot-3.png
          15 kB
        4. test-filetypes-form.php
          1 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17