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

Content Banks does not handle multiple file extensions correctly

    XMLWordPrintable

    Details

    • Sprint:
      Moppies Kanban

      Description

      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.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tusefomal Ferran Recio
              Reporter:
              tusefomal Ferran Recio
              Peer reviewer:
              Amaia Anabitarte
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

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