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

Repositories with specific supported filetypes do not display in filepicker

XMLWordPrintable

    • MOODLE_22_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MDL-34507-master
    • Hide

      lib/form/filemanager.php:127
      - $accepted_types = (array) $this->_options['accepted_types'];
      + $accepted_types = $this->_options['accepted_types'];

      Show
      lib/form/filemanager.php:127 - $accepted_types = (array) $this->_options ['accepted_types'] ; + $accepted_types = $this->_options ['accepted_types'] ;
    • Easy
    • Hide

      Test pre-requisites

      • Enable Google Docs repository
      • Enable Picasa repository
      • Enable Dropbox repository

      Test steps

      1. Create a database resource with a picture field, and add an entry
      2. Make sure Google Docs does not appear in Filepicker
      3. Make sure Dropbox and Picasa appear in Filepicker
      4. Go to your privates files
      5. Hack the code of users/filesedit.php (users/files.php on 2.3 and master) and change accepted_types to

      • '.jpg'
      • array('.jpg')
      • array('image')

      6. Make sure Google Docs does not appear in Filepicker for each parameter
      7. Make sure Dropbox and Picasa appear in Filepicker for each parameter
      8. Now set accepted_types to:

      • '*'
      • array('*')

      9. For both parameters, make sure Dropbox, Picasa and Google Docs appear in Filepicker

      Show
      Test pre-requisites Enable Google Docs repository Enable Picasa repository Enable Dropbox repository Test steps 1. Create a database resource with a picture field, and add an entry 2. Make sure Google Docs does not appear in Filepicker 3. Make sure Dropbox and Picasa appear in Filepicker 4. Go to your privates files 5. Hack the code of users/filesedit.php (users/files.php on 2.3 and master) and change accepted_types to '.jpg' array('.jpg') array('image') 6. Make sure Google Docs does not appear in Filepicker for each parameter 7. Make sure Dropbox and Picasa appear in Filepicker for each parameter 8. Now set accepted_types to: '*' array('*') 9. For both parameters, make sure Dropbox, Picasa and Google Docs appear in Filepicker

      This appears to be caused by the changes made in MDL-30008.

      Any repository which has supported_filetypes other than '*' will not be available in the upload filepicker.

      Steps to replicate:

      1. Add more repositories to your site, eg. googledocs, youtube

      2. Attempt to upload a file.

      Expected: Option to use these repositories for file uploads.

      Result: These repositories will be missing

      3. In lib/form/filemanager.php:127
      - $accepted_types = (array) $this->_options['accepted_types'];
      + $accepted_types = $this->_options['accepted_types'];

      4. Attempt to upload a file again. The missing repositories will be available. But the supported_filetypes filter will not be used.

      I think that the code in repository/lib.php:845 need to be changed to fix this.

            fred Frédéric Massart
            chrisw Chris Wharton
            Marina Glancy Marina Glancy
            Dan Poltawski Dan Poltawski
            Jason Fowler Jason Fowler
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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