Moodle
  1. Moodle
  2. MDL-32981

Private files link should go straight to the editing screen.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2.4, 2.3
    • Component/s: Filepicker
    • Labels:
    • Testing Instructions:
      Hide

      1. Login as admin
      2. Choose a random page, add a 'My private files' block
      3. Click on the button 'Manage my private files' in the block
      4. Make sure that

      • The navigation has selected 'Navigation > Home > My profile > My private files'
      • The cancel button brings you back to the page you were on
      • Uploading a file and clicking 'Save changes' brings you back to the page you were on
      • The file has been uploaded

      5. Now click on 'My private files' from the navigation
      6. Make sure that:

      • The navigation has selected 'Navigation > Home > My profile > My private files'
      • There is no cancel button (because no referer was passed to the form)
      • Uploading a file and clicking 'Save changes' brings you back to that same page
      • The file has been uploaded

      7. Create an assignment 'Upload a single file' activity
      8. Login as an enrolled student
      9. Upload a file to that assignment
      10. Make sure that

      • The cancel button is present and brings you back to the assignment page
      • The file is uploaded successfully

      NB: The cancel button appears when a referer has been passed, so that we can redirect the user to the correct page (upon cancel or submit). When no referer is passed, we don't need a cancel button as we will stay on the same page. That was the behaviour expected for the 'My private files' page.

      Show
      1. Login as admin 2. Choose a random page, add a 'My private files' block 3. Click on the button 'Manage my private files' in the block 4. Make sure that The navigation has selected 'Navigation > Home > My profile > My private files' The cancel button brings you back to the page you were on Uploading a file and clicking 'Save changes' brings you back to the page you were on The file has been uploaded 5. Now click on 'My private files' from the navigation 6. Make sure that: The navigation has selected 'Navigation > Home > My profile > My private files' There is no cancel button (because no referer was passed to the form) Uploading a file and clicking 'Save changes' brings you back to that same page The file has been uploaded 7. Create an assignment 'Upload a single file' activity 8. Login as an enrolled student 9. Upload a file to that assignment 10. Make sure that The cancel button is present and brings you back to the assignment page The file is uploaded successfully NB: The cancel button appears when a referer has been passed, so that we can redirect the user to the correct page (upon cancel or submit). When no referer is passed, we don't need a cancel button as we will stay on the same page. That was the behaviour expected for the 'My private files' page.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
      git@github.com:FMCorz/moodle.git
    • Pull Master Branch:
      MDL-32981-master
    • Rank:
      40152

      Description

      Following up from MDL-23920 (1) the link in navigation to Private files should go straight to the "editing" screen with the filemanager. There is no point in forcing people to hit the "Manage files" button.

      After saving changes, we can still go to "view" screen I guess. I can't think of a better place to go - we can't stay in the editing screen.

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          Can be fixed in STABLE 2.2 too.

          Show
          Martin Dougiamas added a comment - Can be fixed in STABLE 2.2 too.
          Hide
          Marina Glancy added a comment -

          Also when you save changes in private files you need to stay on the same page ("editing")

          Show
          Marina Glancy added a comment - Also when you save changes in private files you need to stay on the same page ("editing")
          Hide
          Martin Dougiamas added a comment -

          If that's possible ... might have to just redirect from the view screen.

          Show
          Martin Dougiamas added a comment - If that's possible ... might have to just redirect from the view screen.
          Hide
          Michael de Raadt added a comment -

          This is not as high a priority as other issues in the "MUST FIX FOR 2.3" list. I suspect we will have to defer it.

          Show
          Michael de Raadt added a comment - This is not as high a priority as other issues in the "MUST FIX FOR 2.3" list. I suspect we will have to defer it.
          Hide
          Martin Dougiamas added a comment -

          On the other hand it's a 10 minute job.

          Show
          Martin Dougiamas added a comment - On the other hand it's a 10 minute job.
          Hide
          Martin Dougiamas added a comment -

          I really think it's worth doing this simple fix as it will really improve experience and performance for everyone, and it fits well with all the other file-related improvements in this release.

          Show
          Martin Dougiamas added a comment - I really think it's worth doing this simple fix as it will really improve experience and performance for everyone, and it fits well with all the other file-related improvements in this release.
          Hide
          Frédéric Massart added a comment -

          Here are the patches for 2.2 and master

          Show
          Frédéric Massart added a comment - Here are the patches for 2.2 and master
          Hide
          Martin Dougiamas added a comment -

          I just showed Fred the other bit for this (to avoid going back to files.php at all)

          Show
          Martin Dougiamas added a comment - I just showed Fred the other bit for this (to avoid going back to files.php at all)
          Hide
          Frédéric Massart added a comment -

          I pushed the updated patch

          Show
          Frédéric Massart added a comment - I pushed the updated patch
          Hide
          Andrew Davis added a comment -

          The code itself looks fine. Consider squashing the 3 commits into one. They each have limited value on their own.

          Also, expand the testing instructions. In what scenario should there be a cancel button? When shouldn't there be a cancel button? I'd also probably include having the tester actually upload a file. Does the file picker in a different context, the assignment module for example, require a quick check to make sure that it still functions correctly?

          Show
          Andrew Davis added a comment - The code itself looks fine. Consider squashing the 3 commits into one. They each have limited value on their own. Also, expand the testing instructions. In what scenario should there be a cancel button? When shouldn't there be a cancel button? I'd also probably include having the tester actually upload a file. Does the file picker in a different context, the assignment module for example, require a quick check to make sure that it still functions correctly?
          Hide
          Frédéric Massart added a comment -

          Thanks Andrew! I have updated my branches so that there is only one commit. I wrote some testing instructions while you were already reviewing, but I will expand them a bit.

          Show
          Frédéric Massart added a comment - Thanks Andrew! I have updated my branches so that there is only one commit. I wrote some testing instructions while you were already reviewing, but I will expand them a bit.
          Hide
          Andrew Davis added a comment -

          Excellent. You are go for integration

          Show
          Andrew Davis added a comment - Excellent. You are go for integration
          Hide
          Dan Poltawski added a comment -

          Hi Fred,

          There is one tiny thing - we don't allow underscores in variable names:
          http://docs.moodle.org/dev/Coding_style#Variables

          If you could fix that up with $cancel_button then it'll be perfect

          thanks
          dan

          Show
          Dan Poltawski added a comment - Hi Fred, There is one tiny thing - we don't allow underscores in variable names: http://docs.moodle.org/dev/Coding_style#Variables If you could fix that up with $cancel_button then it'll be perfect thanks dan
          Hide
          Frédéric Massart added a comment -

          Sorry, missed that part.
          It's fixed

          Show
          Frédéric Massart added a comment - Sorry, missed that part. It's fixed
          Hide
          Dan Poltawski added a comment -

          Integrated, thanks.

          Note: do we need user/files.php anymore??

          Show
          Dan Poltawski added a comment - Integrated, thanks. Note: do we need user/files.php anymore??
          Hide
          Frédéric Massart added a comment -

          No we don't really need it as we are not linking to it anymore.

          Show
          Frédéric Massart added a comment - No we don't really need it as we are not linking to it anymore.
          Hide
          Dan Poltawski added a comment -

          Please could you create an issue to remove it?

          Show
          Dan Poltawski added a comment - Please could you create an issue to remove it?
          Hide
          Dan Poltawski added a comment -

          Taking this off Jason for testing, because we need it testing quicker..

          Show
          Dan Poltawski added a comment - Taking this off Jason for testing, because we need it testing quicker..
          Hide
          Dan Poltawski added a comment -

          Looks good. Thanks Fred for creating the issue to remove that file too.

          Show
          Dan Poltawski added a comment - Looks good. Thanks Fred for creating the issue to remove that file too.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads).

          Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads). Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: