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

Content Banks does not handle multiple file extensions correctly

XMLWordPrintable

    • MOODLE_39_STABLE
    • MDL-69141-master
    • Hide
      1. Install the provided moodle-contentype_html.zip plugin into "contentbank/contentype/html"
        1. Check that no error is displayed during the installation
      2. As admin, go to the content bank and click on the "upload" button
        1. Check that in the file picker specifies only .hp5 and .HTML files as valid extensions.
      Show
      Install the provided  moodle-contentype_html.zip plugin into "contentbank/contentype/html" Check that no error is displayed during the installation As admin, go to the content bank and click on the "upload" button Check that in the file picker specifies only .hp5 and .HTML files as valid extensions.
    • Moppies Kanban

      When two plugins have their own file extensions (for example one with .h5p and one with .HTML) the upload form stops filtering by extension instead of just permit the valid extensions.

      How to reproduce:

      1. Install the provided contenttype_html plugin
      2. Go to the content bank as admin and click on the "upload" button

      Expected: the upload form should only permit upload .h5p and .HTML files

      What happens: the extension filter is disabled.

      Why this happens

      The current upload form uses a content bank method called "get_supported_extensions_as_string" which returns a comma-separated extensions list. This works well with just one extension, the problem is when you have more than one extension. The file picker expects an array of extensions, not a comma-separated.

      The solution is to delete the "get_supported_extensions_as_string" method and create anew method "get_supported_extensions" which is exactly the same but returning an array.

       

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Amaia Anabitarte Amaia Anabitarte
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 1 minute
                3h 1m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.