Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      As a student make sure you can not insert files as shortcut/alias in editors and filemanagers in:

      • assignment submission (both old and new)
      • quiz essay with files
      • workshop submission
      • forum posts

      As a teacher/admin

      • add or edit a resource module
      • make sure that in filemanager you do not have an option to insert a file as a link from wikimedia repository
      Show
      As a student make sure you can not insert files as shortcut/alias in editors and filemanagers in: assignment submission (both old and new) quiz essay with files workshop submission forum posts As a teacher/admin add or edit a resource module make sure that in filemanager you do not have an option to insert a file as a link from wikimedia repository
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-33446-master
    • Rank:
      41339

      Description

      There are several instances in code where filemanager is not allowed to accept file by reference. Do not allow references in editor text fields as well:
      Forum attachments
      Assignment2.2 submissions
      Assignment2.3 submissions and feedback
      Workshop submission

      Do not allow references in quiz essays (both filemanager and editor)

      Also
      mod_resource allows FILE_EXTERNAL (linking to the file directly) which simply does not work in filemanager

        Issue Links

          Activity

          Hide
          Marina Glancy added a comment -

          actually.... imagine student uploads his submission as a reference to the private files. And then changes the file in the private files

          Show
          Marina Glancy added a comment - actually.... imagine student uploads his submission as a reference to the private files. And then changes the file in the private files
          Hide
          Marina Glancy added a comment -

          MDL-33446 Editor form field can filter return types

          • Added possibility for editor form field to specify return_types (default FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE)
          • For assignment, workshop, quiz essay submissions and form posts do not allow FILE_REFERENCE
          • Fixed mod_resource return_types, reset them to default, because filemanager does not know how to work with FILE_EXTERNAL links
          Show
          Marina Glancy added a comment - MDL-33446 Editor form field can filter return types Added possibility for editor form field to specify return_types (default FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE) For assignment, workshop, quiz essay submissions and form posts do not allow FILE_REFERENCE Fixed mod_resource return_types, reset them to default, because filemanager does not know how to work with FILE_EXTERNAL links
          Hide
          Dan Poltawski added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Poltawski added a comment -

          Is that $_options comment necessary?

          Show
          Dan Poltawski added a comment - Is that $_options comment necessary?
          Hide
          Marina Glancy added a comment -

          Dan, it explains what 'return_types'=>7 means.
          Unfortunately I can not put 'return_types'=>FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE in the variable declaration

          Show
          Marina Glancy added a comment - Dan, it explains what 'return_types'=>7 means. Unfortunately I can not put 'return_types'=>FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE in the variable declaration
          Hide
          Dan Poltawski added a comment -

          Integrated, Thanks Marina

          (i think that comment could've been clearer, but anyway)

          Show
          Dan Poltawski added a comment - Integrated, Thanks Marina (i think that comment could've been clearer, but anyway)
          Hide
          Dan Poltawski added a comment -

          Adding docs_required label as Tim points out we need to make sure this is in developer release notes

          Show
          Dan Poltawski added a comment - Adding docs_required label as Tim points out we need to make sure this is in developer release notes
          Hide
          Dan Poltawski added a comment -

          Marina: Tim asks the question why we allow FILE_EXTERNAL in only one place?

          Show
          Dan Poltawski added a comment - Marina: Tim asks the question why we allow FILE_EXTERNAL in only one place?
          Hide
          Marina Glancy added a comment -

          FILE_INTERNAL - is a file copied to moodle.
          FILE_REFERENCE - is a reference to the external/internal file that is actually stored as a row in files table in moodle.

          FILE_EXTERNAL is a link to a file (i.e. http://www.site/filename.jpg). It works all right when you insert an image (video, etc.) into an editor. It also works (and actually the only allowed type) for url form element (or Database URL field).

          Link should never be included in filemanager because it simply does not work there. Only real files should be there. It was just a mistake that it was allowed in mod_resource filemanager.

          Show
          Marina Glancy added a comment - FILE_INTERNAL - is a file copied to moodle. FILE_REFERENCE - is a reference to the external/internal file that is actually stored as a row in files table in moodle. FILE_EXTERNAL is a link to a file (i.e. http://www.site/filename.jpg ). It works all right when you insert an image (video, etc.) into an editor. It also works (and actually the only allowed type) for url form element (or Database URL field). Link should never be included in filemanager because it simply does not work there. Only real files should be there. It was just a mistake that it was allowed in mod_resource filemanager.
          Hide
          Frédéric Massart added a comment -

          I am testing this, but before failing/passing it, I'd like to share what happened and see whether it is expected or in the scope of this issue.

          As a student, I have create a link to one of my Dropbox files in My private files (let's call it cats.jpg). When I attach a file in any of the activities mentioned in the test, I can select cats.jpg. The filemanager then displays the little arrow confirming that this is a link. And to make sure of it, I deleted cats.jpg from my Dropbox and could not access it from Moodle.

          About the last step of the test, as an admin I can add anything to a File resource. What is that exactly that I am not supposed to able to do? What are the repositories that I should use to test this properly?

          Show
          Frédéric Massart added a comment - I am testing this, but before failing/passing it, I'd like to share what happened and see whether it is expected or in the scope of this issue. As a student, I have create a link to one of my Dropbox files in My private files (let's call it cats.jpg). When I attach a file in any of the activities mentioned in the test, I can select cats.jpg. The filemanager then displays the little arrow confirming that this is a link. And to make sure of it, I deleted cats.jpg from my Dropbox and could not access it from Moodle. About the last step of the test, as an admin I can add anything to a File resource. What is that exactly that I am not supposed to able to do? What are the repositories that I should use to test this properly?
          Hide
          Marina Glancy added a comment -

          Fred, this is another issue MDL-33452. At the moment when you pick file from private files that is a reference, even if you pick it as a copy, it copies a reference.
          Please try to test it without references to references

          Show
          Marina Glancy added a comment - Fred, this is another issue MDL-33452 . At the moment when you pick file from private files that is a reference, even if you pick it as a copy, it copies a reference. Please try to test it without references to references
          Hide
          Frédéric Massart added a comment -

          Thanks Marina.

          For the students part, everything works except that reference of reference so the test is 'passed'.
          For the admin/teacher part I am not sure to understand the test.

          Show
          Frédéric Massart added a comment - Thanks Marina. For the students part, everything works except that reference of reference so the test is 'passed'. For the admin/teacher part I am not sure to understand the test.
          Hide
          Marina Glancy added a comment -

          Fred, I changed the testing instructions for teacher

          Show
          Marina Glancy added a comment - Fred, I changed the testing instructions for teacher
          Hide
          Frédéric Massart added a comment -

          Thanks Marina. Passing this test as MDL-33452 will resolve the reference of reference issue.

          Show
          Frédéric Massart added a comment - Thanks Marina. Passing this test as MDL-33452 will resolve the reference of reference issue.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Big thanks for the effort. This is now part of Moodle upstream. Let's wait for regressions, yay! LOL

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Big thanks for the effort. This is now part of Moodle upstream. Let's wait for regressions, yay! LOL Ciao
          Hide
          Mary Cooch added a comment -

          I love this one Getting into the mind of a student!!! Removing the docs required, as this feature has been added here http://docs.moodle.org/23/en/File_FAQ and also here http://docs.moodle.org/23/en/Working_with_files

          Show
          Mary Cooch added a comment - I love this one Getting into the mind of a student!!! Removing the docs required, as this feature has been added here http://docs.moodle.org/23/en/File_FAQ and also here http://docs.moodle.org/23/en/Working_with_files

            People

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

              Dates

              • Created:
                Updated:
                Resolved: