Moodle
  1. Moodle
  2. MDL-33404

Drag/dropping a file should honour all defaults for resources

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Resource
    • Labels:
    • Testing Instructions:
      Hide
      1. Go to admin settings for "File" module (showsize and showtype) and turn them on.
      2. Go to a course, turn editing on
      3. Drag and drop a file into the course
      4. Turn editing off and verify that that file size and type are displayed on the course page beside the link.
      5. Go back to step 1 and turn the defaults off, then verify that new files added do NOT have these displayed.

      Finally none of the new files should have anything for the description on the actual File page (although you will see file size and file type under the description).

      Show
      Go to admin settings for "File" module (showsize and showtype) and turn them on. Go to a course, turn editing on Drag and drop a file into the course Turn editing off and verify that that file size and type are displayed on the course page beside the link. Go back to step 1 and turn the defaults off, then verify that new files added do NOT have these displayed. Finally none of the new files should have anything for the description on the actual File page (although you will see file size and file type under the description).
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-33404_resource_dnd_defaults
    • Rank:
      41278

      Description

      Some things I would like to see fixed for new mod/resource files created by drag/drop:

      1) Don't set the description to the file name, it looks scrappy and useless. It's better off blank by default.
      2) Make sure the new resource honours the current system default resource settings for showsize and showtype

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          Note that the file's size and type are not shown immediately via AJAX, you need to turn editing off first, but I see that as another issue.

          Show
          Martin Dougiamas added a comment - Note that the file's size and type are not shown immediately via AJAX, you need to turn editing off first, but I see that as another issue.
          Hide
          Davo Smith added a comment -

          Setting the description to the filename was added as a workaround for sites where the description was a required field. There was an issue with going to the editing form, after having dragged and dropped a file, and not being allowed to leave the form without filling in the description field.

          Do you have any suggestion about how to work around that issue? (As setting description = filename was the best solution I could come up with).

          I'll add a couple of lines of code to inherit the default file size / type defaults.

          Show
          Davo Smith added a comment - Setting the description to the filename was added as a workaround for sites where the description was a required field. There was an issue with going to the editing form, after having dragged and dropped a file, and not being allowed to leave the form without filling in the description field. Do you have any suggestion about how to work around that issue? (As setting description = filename was the best solution I could come up with). I'll add a couple of lines of code to inherit the default file size / type defaults.
          Hide
          Dan Poltawski added a comment -

          Davo: Martin has got a branch fixing this attached.

          Martin: Davos point stands - if we do this then you are forced to type something in the the description field if you edit the resource.

          (My vote for removing requiremodintro setting alltogether )

          Show
          Dan Poltawski added a comment - Davo: Martin has got a branch fixing this attached. Martin: Davos point stands - if we do this then you are forced to type something in the the description field if you edit the resource. (My vote for removing requiremodintro setting alltogether )
          Hide
          Davo Smith added a comment -

          Oops... I missed the 'pull from repository' bit at the top

          Show
          Davo Smith added a comment - Oops... I missed the 'pull from repository' bit at the top
          Hide
          Martin Dougiamas added a comment -

          I did think about that forced description issue and I don't think it's a problem.

          1) This only applies when resource_requiremodintro is enabled.

          2) If it is enabled, then yes, you're forced to enter a description when you edit it. Great, that's why you set that setting, so that people put in meaningful, helpful descriptions.

          3) If you don't edit the resource, it still looks nice!

          Show
          Martin Dougiamas added a comment - I did think about that forced description issue and I don't think it's a problem. 1) This only applies when resource_requiremodintro is enabled. 2) If it is enabled, then yes, you're forced to enter a description when you edit it. Great, that's why you set that setting, so that people put in meaningful, helpful descriptions. 3) If you don't edit the resource, it still looks nice!
          Hide
          Dan Poltawski added a comment -

          Thanks Martin, i've integrated that now!

          Show
          Dan Poltawski added a comment - Thanks Martin, i've integrated that now!
          Hide
          Andrew Davis added a comment - - edited

          Works as described (and is quite cool).

          Having to enter a description when you first edit the resource seemed a little odd at first but makes sense. We do need to provide some sort of visual indication near the save button however. Right now if you don't notice that description is empty and you click one of the save buttons and it appears like nothing is happening. I've raised MDL-33418

          Passing.

          Show
          Andrew Davis added a comment - - edited Works as described (and is quite cool). Having to enter a description when you first edit the resource seemed a little odd at first but makes sense. We do need to provide some sort of visual indication near the save button however. Right now if you don't notice that description is empty and you click one of the save buttons and it appears like nothing is happening. I've raised MDL-33418 Passing.
          Hide
          Dan Poltawski added a comment -

          Congratulations!

          Your work has made into the latest Moodle release!

          You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

          Show
          Dan Poltawski added a comment - Congratulations! Your work has made into the latest Moodle release! You are only authorised to celebrate after testing 15 Moodle 2.3 QA tests, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: