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

Implicit validation of the the filetypes form element

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4
    • 3.4
    • Forms Library
    • MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-59443-master-filetypesvalidation
    • 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.
    • 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

              mudrd8mz David Mudrák (@mudrd8mz)
              mudrd8mz David Mudrák (@mudrd8mz)
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Simey Lameze Simey Lameze
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Nov/17