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

New filepicker ignores labels from repo plugin

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.2
    • Component/s: Filepicker, Repositories
    • Labels:
      None
    • Testing Instructions:
      Hide

      Testing requires a little hacking because this is an interface for 3rd party repositories:

      1. Open filepicker from any filemanager or textarea-insert-image
      2. Select Upload, make sure the label for a file says "Attachment"
      3. Edit file repository/upload/lib.php and change the label in function get_listing()
      4. Repeat steps 1-2 (refresh page) and make sure the label is changed

      Show
      Testing requires a little hacking because this is an interface for 3rd party repositories: 1. Open filepicker from any filemanager or textarea-insert-image 2. Select Upload, make sure the label for a file says "Attachment" 3. Edit file repository/upload/lib.php and change the label in function get_listing() 4. Repeat steps 1-2 (refresh page) and make sure the label is changed
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-33444-master

      Description

      The new filepicker in 2.3 uses templates for the forms, but no longer respects the label passed through from the repo plugin - for example:
      /repository/upload/lib.php's get_listing method attempts to set the label as follows:

      $ret['upload'] = array('label'=>get_string('attachment', 'repository'), 'id'=>'repo-form');

      This is ignored by the create_upload_form function in /repository/filepicker.js, which just leaves the label as it is in the template.

      The reason I've noticed this is that my audio recording repository (https://github.com/MaxThrax/moodle-repository_recordaudio) no longer works on 2.3 - because it uses the above label to inject its HTML. If there's proper support for doing this (ideally just adding HTML to the upload form, since I still want to use the standard upload mechanism as I do in the current version of my plugin), please point me in the right direction to do that - I can't see any documentation, and after a brief look at the code, I can't work out how I ought to do it either. I'd love to not need to inject HTML into a label, so please do tell me if there's a better way to do it! (and if there's a way to do it "properly" on Moodle 2.0-2.2 as well, please enlighten me!)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12